Micrometer: ElasticMeterRegistry always adds a date format to the index

Created on 2 Nov 2018  路  1Comment  路  Source: micrometer-metrics/micrometer

The current implementation assumes that the index to be used will be composed of the specified index name plus a date format separated by a hyphen.

From ElasticMeterRegistry

return config.index() + "-" + DateTimeFormatter.ofPattern(config.indexDateFormat()).format(dt)

In the environment where I am looking to deploy mm, in conjunction with spring boot & elastic, indexes are pre-provisioned such that we only get 1 index for the duration of the index and as such the idea of date rolling the index would not work.

Currently setting the management.metrics.export.elastic.indexDateFormat= removes the date portion of the index, but the - is still appended meaning that we could not currently match our provided index name.

As a potential fix suggest creating a new property indexDate with a default of true which will continue with the above behavior, but when set to false will not append anything to the provide index name.

If you would like, I will try to raise a PR to fix this over the next couple of days. If you would prefer to fix it yourself within the existing project, please let me know and I will simply leave it with you.

Most helpful comment

Using indices without any dateformat is getting more and more common with rollover indices, so I think that this is a must.

>All comments

Using indices without any dateformat is getting more and more common with rollover indices, so I think that this is a must.

Was this page helpful?
0 / 5 - 0 ratings