-
Notifications
You must be signed in to change notification settings - Fork 4.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Support Telemetry Schema Url in tracing and metrics #113034
Conversation
Note regarding the
|
Note regarding the
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
src/libraries/System.Diagnostics.DiagnosticSource/tests/MetricsTests.cs
Outdated
Show resolved
Hide resolved
/azp run runtime-libraries-coreclr outerloop |
Azure Pipelines successfully started running 1 pipeline(s). |
...aries/System.Diagnostics.DiagnosticSource/ref/System.Diagnostics.DiagnosticSourceActivity.cs
Outdated
Show resolved
Hide resolved
src/libraries/System.Diagnostics.DiagnosticSource/src/System/Diagnostics/ActivitySource.cs
Outdated
Show resolved
Hide resolved
...ibraries/System.Diagnostics.DiagnosticSource/src/System/Diagnostics/ActivitySourceOptions.cs
Outdated
Show resolved
Hide resolved
...ibraries/System.Diagnostics.DiagnosticSource/src/System/Diagnostics/ActivitySourceOptions.cs
Show resolved
Hide resolved
/azp run runtime-libraries-coreclr outerloop |
Azure Pipelines successfully started running 1 pipeline(s). |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
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 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🎉 Great to see this!
Fixes #63651