Skip to content

[do not merge] PoC: Call OTel's instrument_app in Flask integration #4600

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

Closed
wants to merge 1 commit into from

Conversation

sentrivana
Copy link
Contributor

@sentrivana sentrivana commented Jul 21, 2025

Minimal PoC for how we could invoke OTel's Flask auto-instrumentation without needing the user to do any additional setup (or requiring them to move their sentry_sdk.init()).

Note that this PR results in double instrumentation since we haven't disabled Sentry's tracing. This is just for showing that we can invoke OTel like this.

Example app:

from flask import Flask
import sentry_sdk

sentry_sdk.init(
    debug=True,
    traces_sample_rate=1.0,
)

app = Flask(__name__)

@app.route("/")
def home():
    return 'ok'

Copy link

codecov bot commented Jul 21, 2025

❌ 13771 Tests Failed:

Tests completed Failed Passed Skipped
21220 13771 7449 1097
View the top 3 failed test(s) by shortest run time
tests.integrations.httpx.test_httpx::test_option_trace_propagation_targets[httpx_client0-None-https://example.com/-False]
Stack Traces | 0s run time
.tox/py3.9-httpx-latest/lib/python3.9.../site-packages/pytest_httpx/__init__.py:67: in httpx_mock
    mock._assert_options()
.tox/py3.9-httpx-latest/lib/python3.9.../site-packages/pytest_httpx/_httpx_mock.py:319: in _assert_options
    assert not callbacks_not_executed, (
E   AssertionError: The following responses are mocked but not requested:
E     - Match any request
E     
E     If this is on purpose, refer to https://github..../blob/master/README.md#allow-to-register-more-responses-than-what-will-be-requested
E   assert not [<pytest_httpx._request_matcher._RequestMatcher object at 0x7f3c3655cb80>]
tests.integrations.httpx.test_httpx::test_option_trace_propagation_targets[httpx_client14-trace_propagation_targets14-https://example.com-True]
Stack Traces | 0s run time
.tox/py3.9-httpx-latest/lib/python3.9.../site-packages/pytest_httpx/__init__.py:67: in httpx_mock
    mock._assert_options()
.tox/py3.9-httpx-latest/lib/python3.9.../site-packages/pytest_httpx/_httpx_mock.py:319: in _assert_options
    assert not callbacks_not_executed, (
E   AssertionError: The following responses are mocked but not requested:
E     - Match any request
E     
E     If this is on purpose, refer to https://github..../blob/master/README.md#allow-to-register-more-responses-than-what-will-be-requested
E   assert not [<pytest_httpx._request_matcher._RequestMatcher object at 0x7f3c3514a280>]
tests.integrations.httpx.test_httpx::test_option_trace_propagation_targets[httpx_client7-trace_propagation_targets7-https://good.example.net-True]
Stack Traces | 0s run time
.tox/py3.9-httpx-latest/lib/python3.9.../site-packages/pytest_httpx/__init__.py:67: in httpx_mock
    mock._assert_options()
.tox/py3.9-httpx-latest/lib/python3.9.../site-packages/pytest_httpx/_httpx_mock.py:319: in _assert_options
    assert not callbacks_not_executed, (
E   AssertionError: The following responses are mocked but not requested:
E     - Match any request
E     
E     If this is on purpose, refer to https://github..../blob/master/README.md#allow-to-register-more-responses-than-what-will-be-requested
E   assert not [<pytest_httpx._request_matcher._RequestMatcher object at 0x7f3c351d17f0>]

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

@sentrivana sentrivana closed this Jul 29, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy