Skip to content

Dual POTel setup improvements #4401

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

Draft
wants to merge 5 commits into
base: potel-base
Choose a base branch
from
Draft

Conversation

sentrivana
Copy link
Contributor

@sentrivana sentrivana commented May 19, 2025

  • If a TracerProvider already exists, patch it. TracerProvider is a singleton, so if we aren't the first one setting it up, we need to use the existing one.
    • In tests, reset TracerProvider after each test so that we start with a clean slate and it gets set up anew on init.
  • If an OTel span starts, record its instrumentation_scope.name (e.g. opentelemetry.instrumentation.flask) and turn it into origin at the end. This allows us to differentiate between spans auto-instrumented by Sentry and OTel.

Copy link

codecov bot commented May 19, 2025

⚠️ Parser warning

The parser emitted a warning. Please review your JUnit XML file:

Warning while parsing testcase attributes: Limit of string is 1000 chars, for name, we got 2301 at 1:2560 in /home/runner/work/sentry-python/sentry-python/.junitxml

❌ 52 Tests Failed:

Tests completed Failed Passed Skipped
20186 52 20134 4417
View the top 3 failed test(s) by shortest run time
tests.opentelemetry.test_potel::test_root_span_transaction_payload_started_with_otel_only
Stack Traces | 0.081s run time
tests/opentelemetry/test_potel.py:45: in test_root_span_transaction_payload_started_with_otel_only
    assert trace_context["origin"] == "manual"
E   AssertionError: assert 'tests.opentelemetry.test_potel' == 'manual'
E     
E     - manual
E     + tests.opentelemetry.test_potel
tests.opentelemetry.test_potel::test_child_span_payload_started_with_otel_only
Stack Traces | 0.082s run time
tests/opentelemetry/test_potel.py:65: in test_child_span_payload_started_with_otel_only
    assert span["origin"] == "manual"
E   AssertionError: assert 'tests.opentelemetry.test_potel' == 'manual'
E     
E     - manual
E     + tests.opentelemetry.test_potel
tests.opentelemetry.test_potel::test_child_span_payload_started_with_otel_only
Stack Traces | 0.088s run time
tests/opentelemetry/test_potel.py:65: in test_child_span_payload_started_with_otel_only
    assert span["origin"] == "manual"
E   AssertionError: assert 'tests.opentelemetry.test_potel' == 'manual'
E     - manual
E     + tests.opentelemetry.test_potel

To view more test analytics, go to the Test Analytics Dashboard
📋 Got 3 mins? Take this short survey to help us improve Test Analytics.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant