Micrometer: ElasticMeterRegistry: template index pattern is hardcoded to metrics*

Created on 20 Jul 2020  路  2Comments  路  Source: micrometer-metrics/micrometer

The index name is configurable:
https://github.com/micrometer-metrics/micrometer/blob/a0e46fd4438dbcb9aeead1a5ebbf59d9c5bba0fb/implementations/micrometer-registry-elastic/src/main/java/io/micrometer/elastic/ElasticMeterRegistry.java#L291-L294

However, the index pattern in the template is not:
https://github.com/micrometer-metrics/micrometer/blob/a0e46fd4438dbcb9aeead1a5ebbf59d9c5bba0fb/implementations/micrometer-registry-elastic/src/main/java/io/micrometer/elastic/ElasticMeterRegistry.java#L93-L95

This results in two issues:

  1. If my custom index-pattern doesn't start with metrics, the template won't apply
  2. The template pattern metrics* is too broad and prevents me from using indices like metrics-something-* in other applications (in my case, the config of _source breaks the other application. See #1629)

Making the template index-pattern configurable solves these issues.

bug elastic

Most helpful comment

@micheljung Thanks for the issue. This seems to be an oversight. I created https://github.com/micrometer-metrics/micrometer/pull/2197 to try to resolve this.

All 2 comments

@micheljung Thanks for the issue. This seems to be an oversight. I created https://github.com/micrometer-metrics/micrometer/pull/2197 to try to resolve this.

Thanks for the quick fix! #2197 looks exactly as it should be :-)

Was this page helpful?
0 / 5 - 0 ratings