Support Telemetry Schema Url in tracing and metrics#113034
Support Telemetry Schema Url in tracing and metrics#113034tarekgh merged 4 commits intodotnet:mainfrom
Conversation
|
Note regarding the |
|
Note regarding the |
There was a problem hiding this comment.
PR Overview
This PR adds support for a Telemetry Schema URL parameter in tracing and metrics to address #63651. The changes include introducing a TelemetrySchemaUrl property in ActivitySourceOptions, Meter, and related types; updating constructor and initialization signatures to propagate the new parameter; and adjusting MetricsEventSource event definitions and tests to include the TelemetrySchemaUrl.
Reviewed Changes
| File | Description |
|---|---|
| src/libraries/System.Diagnostics.DiagnosticSource/src/System/Diagnostics/ActivitySourceOptions.cs | Added TelemetrySchemaUrl property to options used for ActivitySource creation |
| src/libraries/System.Diagnostics.DiagnosticSource/src/System/Diagnostics/Metrics/Meter.cs | Updated initialization and constructors to include telemetrySchemaUrl parameter |
| src/libraries/System.Diagnostics.DiagnosticSource/src/System/Diagnostics/ActivitySource.cs | Updated ActivitySource constructors and properties to propagate TelemetrySchemaUrl |
| src/libraries/System.Diagnostics.DiagnosticSource/src/System/Diagnostics/Metrics/MeterOptions.cs | Added TelemetrySchemaUrl property to MeterOptions |
| src/libraries/System.Diagnostics.DiagnosticSource/tests/MetricEventSourceTests.cs | Updated Meter creation in tests to supply the new TelemetrySchemaUrl value |
| src/libraries/System.Diagnostics.DiagnosticSource/tests/ActivitySourceTests.cs | Added TelemetrySchemaUrl assertions in ActivitySource tests |
| src/libraries/System.Diagnostics.DiagnosticSource/ref/System.Diagnostics.DiagnosticSourceActivity.cs | Updated reference definitions to expose TelemetrySchemaUrl property and overloads |
| src/libraries/System.Diagnostics.DiagnosticSource/src/System/Diagnostics/Metrics/MetricsEventSource.cs | Updated event methods to include TelemetrySchemaUrl in event logging |
| src/libraries/System.Diagnostics.DiagnosticSource/tests/MetricsTests.cs | Updated meter creation tests to check TelemetrySchemaUrl handling |
Copilot reviewed 10 out of 10 changed files in this pull request and generated 1 comment.
|
/azp run runtime-libraries-coreclr outerloop |
|
Azure Pipelines successfully started running 1 pipeline(s). |
|
/azp run runtime-libraries-coreclr outerloop |
|
Azure Pipelines successfully started running 1 pipeline(s). |
|
So what is required for this to work end to end? Is more needed from the OTel SDK and the OTLP exporter? |
Yes. @lmolkova is following up and planning to use it in E2E scenario. |
Ya OTel SDK will need to be updated to set these new SchemaUrl properties on the instrumentation scope when serializing. For example here is where we handle ActivitySource Version + Tags: https://github.com/open-telemetry/opentelemetry-dotnet/blob/1b555c1201413f2f55f2cd3c4ba03ef4b615b6b5/src/OpenTelemetry.Exporter.OpenTelemetryProtocol/Implementation/Serializer/ProtobufOtlpTraceSerializer.cs#L127-L132 |
Fixes #63651