Add metric support for grpc - #5923
Conversation
|
|
||
| testSpanExporter = InMemorySpanExporter.create(); | ||
| testMetricExporter = InMemoryMetricExporter.create(); | ||
| testMetricExporter = InMemoryMetricExporter.create(AggregationTemporality.DELTA); |
There was a problem hiding this comment.
Cumulative metrics are a bad fit for tests. We have a shard instance of the SDK for all tests. If temporality is cumulative, then metrics that initially received measurements for one test will continue to report for the remaining tests. The result is very cumbersome to assert against and debug.
| @Override | ||
| public AggregationTemporality getAggregationTemporality(InstrumentType instrumentType) { | ||
| return AggregationTemporality.CUMULATIVE; | ||
| return AggregationTemporality.DELTA; |
There was a problem hiding this comment.
@jack-berg this seems to make a micrometer test a bit flaky https://ge.opentelemetry.io/s/mwt7qlr5nwqig/tests/:instrumentation:micrometer:micrometer-1.5:javaagent:testBaseTimeUnit/io.opentelemetry.javaagent.instrumentation.micrometer.v1_5.TimerSecondsTest/testTimerWithBaseUnitSeconds()?expanded-stacktrace=WyIwIl0&top-execution=1
To reproduce insert Thread.sleep(1_000); between timer.record() calls. Any ideas where the issue is?
* Add metric support for grpc * Spotless
Was surprised to learn that gRPC metrics weren't already enabled. Any reason not to enable them?