Hi @maxim and @manu ,
We have used both SimpleMeterRegistry and PrometheusMeterRegistry. Please find the below analysis.
when we firstly used the following code using SimpleMeterRegistry in HelloActivity example, the code was success but we were not able to find out the tags in prometheus metrics
StatsReporter reporter = new MicrometerClientStatsReporter((new SimpleMeterRegistry()));
Map<String, String> mp = new HashMap<>();
mp.put("prodCode", "ODE");
mp.put("regionId", "US_WEST_2");
Then when we change to PrometheusMeterRegistry with following code
StatsReporter reporter = new MicrometerClientStatsReporter(new
PrometheusMeterRegistry(PrometheusConfig.DEFAULT));
Map<String, String> mp = new HashMap<>();
mp.put("prodCode", "ODE");
mp.put("regionId", "US_WEST_2");
Exception: Prometheus requires that all meters with the same name have the same set of tag keys. There is already an existing meter named 'temporal_request_latency_seconds' containing tag keys [Namespace, Operation, TaskQueue, WorkflowType, prodCode, regionId]. The meter you are attempting to register has keys [Operation, prodCode, regionId].
we are getting exception which means that userDefined extra tags which we passed in above has been considered but we cannot find the same metrics “temporal_request_latency_seconds” in prometheus server . So looks like something is missing .
We are getting pattern name like “temporal_DescribeNamespace_temporal_request_latency_count” in prometheus which means somehow “temporal_DescribeNamespace_” is getting appended
We are getting the following exception when we are trying to run the sample with PrometheusMeterRegistry
Aug 26, 2020 9:11:30 PM io.grpc.internal.SerializingExecutor run
SEVERE: Exception while executing runnable io.grpc.internal.ClientCallImpl$ClientStreamListenerImpl$1StreamClosed@45837160
java.lang.IllegalArgumentException: Prometheus requires that all meters with the same name have the same set of tag keys. There is already an existing meter named ‘temporal_request_latency_seconds’ containing tag keys [Namespace, Operation, TaskQueue, WorkflowType, prodCode, regionId]. The meter you are attempting to register has keys [Operation, prodCode, regionId].
at io.micrometer.prometheus.PrometheusMeterRegistry.lambda$applyToCollector$16(PrometheusMeterRegistry.java:419)
at java.util.concurrent.ConcurrentHashMap.compute(ConcurrentHashMap.java:1877)
at io.micrometer.prometheus.PrometheusMeterRegistry.applyToCollector(PrometheusMeterRegistry.java:403)
at io.micrometer.prometheus.PrometheusMeterRegistry.newTimer(PrometheusMeterRegistry.java:197)
at io.micrometer.core.instrument.MeterRegistry.lambda$timer$2(MeterRegistry.java:308)
at io.micrometer.core.instrument.MeterRegistry.getOrCreateMeter(MeterRegistry.java:612)
at io.micrometer.core.instrument.MeterRegistry.registerMeterIfNecessary(MeterRegistry.java:566)
at io.micrometer.core.instrument.MeterRegistry.timer(MeterRegistry.java:306)
at io.micrometer.core.instrument.Timer$Builder.register(Timer.java:539)
at io.micrometer.core.instrument.MeterRegistry.timer(MeterRegistry.java:433)
at io.temporal.common.reporter.MicrometerClientStatsReporter.reportTimer(MicrometerClientStatsReporter.java:69)