Unit Test to Validate Metric Collection #5637
-
Given I'm testing a aspnetcore application using The aspnetcore application being tested isn't an actual API, just one to verify various functionality, so exposing endpoints or any other functionality isn't a concern. As we upgrade our OTEL packages, I'd like to verify which metrics are added/renamed, etc, so we can better monitor data ingestion levels with releases |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 3 replies
-
@JohnYoungers You could use InMemoryExporter to collect the metrics for verification. e.g. https://github.com/open-telemetry/opentelemetry-dotnet-contrib/blob/main/test/OpenTelemetry.Instrumentation.AspNetCore.Tests/MetricTests.cs. |
Beta Was this translation helpful? Give feedback.
@JohnYoungers You could use InMemoryExporter to collect the metrics for verification. e.g. https://github.com/open-telemetry/opentelemetry-dotnet-contrib/blob/main/test/OpenTelemetry.Instrumentation.AspNetCore.Tests/MetricTests.cs.