[Core] Tracing updates#39563
Merged
pvaneck merged 15 commits intoAzure:mainfrom Mar 5, 2025
Merged
Conversation
4072688 to
5268fb4
Compare
Collaborator
|
API change check APIView has identified API level changes in this PR and created following API reviews. |
be04837 to
c81d021
Compare
Signed-off-by: Paul Van Eck <paulvaneck@microsoft.com>
c81d021 to
74e47e4
Compare
Signed-off-by: Paul Van Eck <paulvaneck@microsoft.com>
lmolkova
reviewed
Feb 11, 2025
lmolkova
left a comment
There was a problem hiding this comment.
It looks great - thanks a lot for putting it together!
Left some naming suggestions and other minor suggestions
Signed-off-by: Paul Van Eck <paulvaneck@microsoft.com>
kashifkhan
reviewed
Feb 18, 2025
kashifkhan
reviewed
Feb 18, 2025
kashifkhan
reviewed
Feb 18, 2025
Signed-off-by: Paul Van Eck <paulvaneck@microsoft.com>
Signed-off-by: Paul Van Eck <paulvaneck@microsoft.com>
Signed-off-by: Paul Van Eck <paulvaneck@microsoft.com>
Signed-off-by: Paul Van Eck <paulvaneck@microsoft.com>
Signed-off-by: Paul Van Eck <paulvaneck@microsoft.com>
Contributor
kristapratico
left a comment
There was a problem hiding this comment.
Mostly nits and questions 🐱
Signed-off-by: Paul Van Eck <paulvaneck@microsoft.com>
pvaneck
commented
Mar 4, 2025
Member
Author
pvaneck
left a comment
There was a problem hiding this comment.
Thanks, @kristapratico, for the feedback!
Signed-off-by: Paul Van Eck <paulvaneck@microsoft.com>
kristapratico
approved these changes
Mar 5, 2025
kashifkhan
approved these changes
Mar 5, 2025
Member
Author
|
Verified that the azure-core-tracing-opentelemetry live tests still work with these changes. Adding live tests for native tracing here: #39945 |
allenkim0129
pushed a commit
to allenkim0129/azure-sdk-for-python
that referenced
this pull request
Mar 11, 2025
This introduces native OpenTelemetry tracing to Azure Core. Signed-off-by: Paul Van Eck <paulvaneck@microsoft.com>
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.
Additional context: https://gist.github.com/pvaneck/12273663942e70e71cea36bf40716d8d
This introduces native OpenTelemetry tracing to Azure Core. This is intended to be an alternative/replacement to the
azure-core-tracing-opentelemetryplugin.To enable native OpenTelemetry tracing, users need to:
opentelemetry-apiinstalled.settings.tracing_implementationis not set.settings.tracing_enabledis set toTrue.If
setting.tracing_implementationis set, the tracing plugin will be used instead of the native tracing. Ifsettings.tracing_enabledis set toFalse, tracing will be disabled.Main changes
opentelemetry-apiis added as an optional dependency, and is needed to enable native tracing.OpenTelemetryTracerclass was added to theazure.core.tracing.opentelemetrymodule. This is a wrapper around the OpenTelemetry tracer that is used to create spans for Azure SDK operations.get_tracermethod to the newazure.core.instrumentationmodule. This method returns an instance of theOpenTelemetryTracerclass.TracingOptionsTypedDict class was added to define the options that SDK users can use to configure tracing per-operation. These options include the ability to enable or disable tracing and set additional attributes on spans.- Example usage:
client.method(tracing_options={"enabled": True, "attributes": {"foo": "bar"}})DistributedTracingPolicyanddistributed_trace/distributed_trace_asyncdecorators now uses the OpenTelemetry tracer if it is available and native tracing is enabled._instrumentation_configclass variable to configure the OpenTelemetry tracer used in method span creation. Possible configuration options arelibrary_name,library_version,schema_url, andattributes.DistributedTracingPolicynow accepts ainstrumentation_configkeyword argument to configure the OpenTelemetry tracer used in HTTP span creation.