feat: add option to exclude specific default metrics from collection#689
feat: add option to exclude specific default metrics from collection#689kwaszczuk wants to merge 2 commits into
Conversation
jdmarshall
left a comment
There was a problem hiding this comment.
LGTM.
@zbjornson @SimenB how do we feel about this one?
jdmarshall
left a comment
There was a problem hiding this comment.
Needs a changelog entry.
|
LGTM too. Either approach (include or exclude) seems reasonable.
Tangent, but I've wondered if we should remove this requirement and instead make it part of the maintainers' release process. It always creates merge conflicts when any other PR is merged. |
FWIW, the OpenTelemetry project also requires contributors to add changelog entries with PRs and it is a massive pain when trying to contribute. Big +1 to removing that requirement. |
Fixes: #623 (I believe it was incorrectly marked as fixed)
This PR adds
excludeoption to theDefaultMetricsCollectorConfigurationthat allows to omit certain group of metrics from being collected.My own use case is that I use a custom implementation of
eventLoopLagmetrics (though based on the original one), so I need to exclude them to avoid conflicts in registry, but others may want to also use it to remove redundant and unused metrics.An alternative approach would be to expose the exports from
lib/metricsin the public interface, allowing users to import and manually register only the specific metrics they need. I’m not sure, though, which approach is better - this one or theexcludeapproach.