-
Notifications
You must be signed in to change notification settings - Fork 624
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
When Flask activation is missing, do not emit a log message #253
When Flask activation is missing, do not emit a log message #253
Conversation
If a Flask request doesn't have an active span, it just means that it was initialized via a mechanism that doesn't run `before_request`, like `app.test_request_context` or even manually. It is okay and instrumentation still works.
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.
Thanks for the PR! The branch needs updating and I added a comment regarding where in the changelog this should be. Once the branch is updated we can merge!
CHANGELOG.md
Outdated
@@ -21,6 +21,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 | |||
([#212](https://github.com/open-telemetry/opentelemetry-python-contrib/pull/212)) | |||
- `opentelemetry-instrumentation-fastapi` Added support for excluding some routes with env var `OTEL_PYTHON_FASTAPI_EXCLUDED_URLS` | |||
([#237](https://github.com/open-telemetry/opentelemetry-python-contrib/pull/237)) | |||
- `opentelemetry-instrumentation-flask` Do not emit a warning message for request contexts created with `app.test_request_context` or manually. |
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.
This should probably go under Changed
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.
Done in 7a97ccd.
@codeboten since my changes are a merge of |
@jpmelos |
@lzchen all checks passed now. |
Description
If a Flask request doesn't have an active span, it just means that it was initialized via a mechanism that doesn't run
before_request
, likeapp.test_request_context
or even manually. It is okay and instrumentation still works.Fixes #160.
Type of change
How Has This Been Tested?
I ran the same script that is in #160 and I didn't get the warning message.
Does This PR Require a Core Repo Change?
Checklist:
See contributing.md for styleguide, changelog guidelines, and more.
Unit tests have been addedNot neededDocumentation has been updatedNot needed