You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Is your feature request related to a problem? Please describe.
MetricsUtils.withSingleMetric - MetricsUtils.java - provides a nice utility to hide the creation, configuration and publishing of metrics. The existing overloads however, assume that the user needs to know the name/value/unit of at least the first metric to add. This is not always true. I'd like to provide a Consumer<MetricLogger> that will add metrics based on some conditional logic.
The main use case my team has
We're emitting a number of metrics - ~10 metrics - that all have the same config (e.g. dimensions) that's meant to be different from MetricsUtils.metricsLogger() i.e. we need a new metrics logger instance
The names of those metrics are generated dynamically - think loops, appending different constants - to generate those names
So, ideally, we create a new instance of a metrics logger, and then rely on to emit those 10 different metrics.
Describe the solution you'd like
Introduce a new method, an overload of MetricsUtils.withSingleMetric or even a new name MetricsUtils.withMetric as follows
Is your feature request related to a problem? Please describe.
MetricsUtils.withSingleMetric
- MetricsUtils.java - provides a nice utility to hide the creation, configuration and publishing of metrics. The existing overloads however, assume that the user needs to know the name/value/unit of at least the first metric to add. This is not always true. I'd like to provide aConsumer<MetricLogger>
that will add metrics based on some conditional logic.The main use case my team has
So, ideally, we create a new instance of a metrics logger, and then rely on to emit those 10 different metrics.
Describe the solution you'd like
Introduce a new method, an overload of
MetricsUtils.withSingleMetric
or even a new nameMetricsUtils.withMetric
as followswhich would allow the user to freely configure and add metrics via their provided
Consumer<MetricsLogger>
Describe alternatives you've considered
Additional context
The text was updated successfully, but these errors were encountered: