apache / accumulo

Apache Accumulo
https://accumulo.apache.org
Apache License 2.0
1.06k stars 445 forks source link

Use Metric.getDescription() when constructing a Micrometer instrument #4870

Open DomGarguilo opened 6 days ago

DomGarguilo commented 6 days ago

Originally discussed in this thread: https://github.com/apache/accumulo/pull/4850#issuecomment-2329784720

PR #4850 is adding a new Metric enum that contains information pertaining to each metric, notably its name and description. This ticket stands to suggest we use the description that exists in the enum as the description for the corresponding Micrometer instrument. These fields in the Metric enum are rendered out to a markdown file but can also be used in this case.

For example for the metric BLOCKCACHE_INDEX_HITCOUNT we use the name and description from the enum:

 FunctionCounter.builder(BLOCKCACHE_INDEX_HITCOUNT.getName(), indexCache, getHitCount) 
     .description(BLOCKCACHE_INDEX_HITCOUNT.getDescription()).register(registry); 

This would make it so there would only be on place that we would need to maintain the description of a metric instead of two places.

DomGarguilo commented 6 days ago

This ticket can only be completed once PR #4850 is merged.