Open Spikhalskiy opened 2 years ago
Since then I used this approach in SDK tests for metrics and it worked out quite fine. This is an example of using this approach in Temporal code: https://github.com/temporalio/sdk-java/blob/37a0e463fae2312882b5c946f423a0dbf85f9666/temporal-sdk/src/test/java/io/temporal/client/functional/MetricsTest.java#L76
Thank you @Spikhalskiy , I have started to work on this
Temporal should provide a sample for users on how they may check the metrics in unit tests. I propose to wire MetricsScope with our standard MicrometerClientStatsReporter initialized with SimpleMeterRegistry micrometer. A little bit like micrometer does in one of their tests: https://www.programcreek.com/java-api-examples/?code=micrometer-metrics%2Fmicrometer%2Fmicrometer-master%2Fmicrometer-test%2Fsrc%2Fmain%2Fjava%2Fio%2Fmicrometer%2Fcore%2Ftck%2FTimerTest.java