Repository navigation
feat: System.Diagnostics.Metrics bridge & OpenTelemetry integration (v1.0.51) - #6
Merged
Merged
Conversation
…Telemetry backing
…ntegration (v1.0.51) - Add core IMetricMeterBridge, MetricFlowMeterBridge, and TagCardinalityGuard in DotnetKit.MetricFlow - Wire automatic Meter dispatch into MetricTrackerBase and CodeTracker for duration, items, active, exceptions, and throughput - Create DotnetKit.MetricFlow.OpenTelemetry package with .AddMetricFlowInstrumentation() and WithTraceContext() - Add end-to-end OpenTelemetryConsoleExample demonstrating OTel console export, dotnet-counters, and cardinality clamping - Add unit and integration test suites covering net8.0 and net10.0 - Update README.md, ROADMAP.md, and CHANGELOG.md for v1.0.51
…ricFlowOpenTelemetryBuilder
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
This PR implements iteration v1.0.51, adding native
System.Diagnostics.MetricsBCL instrumentation toDotnetKit.MetricFlow, releasing the companion packageDotnetKit.MetricFlow.OpenTelemetry, and adding an end-to-end console example.Key Changes
DotnetKit.MetricFlow):IMetricMeterBridge,MetricFlowMeterBridge, andMetricFlowMeterRegistry: Map MetricFlow trackers and metrics ({metricName}.duration,{metricName}.total,{metricName}.items,{metricName}.exceptions,{metricName}.active) directly to BCLMeter,Counter,Histogram, andUpDownCounter.TagCardinalityGuard: Enforces configurable tag cardinality limits (MaxUniqueTagValues, default 50) and clamps high-cardinality values to[Other]to prevent memory leaks and TSDB degradation.MetricTracker,CodeTracker,In(),Out(), and local snapshot APIs.DotnetKit.MetricFlow.OpenTelemetry):.AddMetricFlowInstrumentation(...)forMeterProviderBuilder.WithTraceContext()capturesActivity.Current(trace_id,span_id) without coupling core MetricFlow to OpenTelemetry.MetricFlowTracerProviderBuilderExtensions: Adds MetricFlowActivitySourcefor distributed tracing.examples/OpenTelemetryConsoleExample: Demonstrates OpenTelemetry console export, high-cardinality protection, anddotnet-countersmonitoring.tests/MetricFlow.Tests/MetricMeterBridgeTests.cs(11 tests).tests/MetricFlow.OpenTelemetry.Tests/(5 tests withInMemoryExporter).net8.0andnet10.0.README.md,ROADMAP.md, andCHANGELOG.md.Verification
dotnet buildsucceeded with 0 warnings/errors.dotnet testpassed 139/139 tests across.NET 8.0and.NET 10.0.