-
Notifications
You must be signed in to change notification settings - Fork 651
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
suppress instrument boto3 XRay.put_trace_segments() #1291
Conversation
I think there is an existing mechanism to do exactly this. Have you seen how other exporters solve the same problem? I think they configure the active tracing context to disable tracing and then any instrumented code inside the exporter code-path is not traced. Recommend to look into that and replicate it in the xray exporter. |
Found it. Examples: opentelemetry-python/opentelemetry-sdk/src/opentelemetry/sdk/trace/export/__init__.py Line 311 in 97b602f
opentelemetry-python/opentelemetry-sdk/src/opentelemetry/sdk/trace/export/__init__.py Line 81 in 97b602f
opentelemetry-python/opentelemetry-sdk/src/opentelemetry/sdk/trace/export/__init__.py Line 311 in 97b602f
|
@owais That's a sweet example, I also found this test which was useful to help me understand how it works: Lines 159 to 169 in 97b602f
|
Thanks! now set context |
@owais Kindly ping that do I miss anything? |
Can you open up the same pr in the contrib repo? |
Yes, will do. |
Description
I am going to create an AWS XRay exporter in OpenTelemetry-Python, to emit telemetry data to AWS XRay service via boto3 API XRay.put_trace_segments(). This PR is the prerequisite for this in-process exporter.
When I was working on the AWSXrayExporter, the botocore instrumentor would instrument function
XRay.put_trace_segments()
inside of AWSXrayExporter, causes infinite recursive loop. This PR is inspired from AWS XRay SDK, skip instrument this specific function to avoid infinite recursion.Fixes # (issue)
Type of change
Please delete options that are not relevant.
How Has This Been Tested?
Please describe the tests that you ran to verify your changes. Provide instructions so we can reproduce. Please also list any relevant details for your test configuration
End to end test
Have created the AWSXrayExporter in local and enable botocore instrumentor in my test App to instrument a boto3 S3.list_buckets function. No infinite recursion problem happen.
Covered by unit test
Checklist: