apm-agent-java icon indicating copy to clipboard operation
apm-agent-java copied to clipboard

Add a "enable_metrics" or "include_metrics" option

Open fbaligand opened this issue 11 months ago • 2 comments

Is your feature request related to a problem?

Currently, I'm able to define which metrics are disabled, but on the contrary, I can't define which metrics are enabled/included. So with a library like micrometers, lots of metrics are by default included, that is too much.

Describe the solution you'd like

I would like a new option that allows to define which metrics are enabled/disabled. It could be called "enable_metrics" or "include_metrics", and it would be complementary with "disable_metrics". First "enable_metrics" define a first list of collected metrics, then "disable_metrics" remove some metrics from this list.

Describe alternatives you've considered

I don't see an alternative

fbaligand avatar Jul 11 '23 22:07 fbaligand

Hi, thank you for the suggestion, it seems quite reasonable. However we don't have the resources to priortize this enhancement any time soon. We'd be delighted for a contribution that enables this!

If you (or anyone) does look at contributing a PR that enables this, it's worth considering whether the enable_metrics would apply to all metrics or only custom (ie non-JVM metrics). Perhaps enable_custom_metrics might be a better name in that case

jackshirazi avatar Jul 17 '23 16:07 jackshirazi

Thanks for the answer. This would be a nice enhancement to implement. Maybe I will give it a try.

fbaligand avatar Jul 18 '23 22:07 fbaligand