Skip to content

Commit

Permalink
When Flask activation is missing, do not emit a log message (#253)
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
jpmelos authored Dec 15, 2020
1 parent dc24b9d commit 20c1cb9
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
([#236](https://github.com/open-telemetry/opentelemetry-python-contrib/pull/236))
- `opentelemetry-instrumentation-asgi`, `opentelemetry-instrumentation-falcon`, `opentelemetry-instrumentation-flask`, `opentelemetry-instrumentation-pyramid`, `opentelemetry-instrumentation-wsgi` Renamed `host.port` attribute to `net.host.port`
([#242](https://github.com/open-telemetry/opentelemetry-python-contrib/pull/242))
- `opentelemetry-instrumentation-flask` Do not emit a warning message for request contexts created with `app.test_request_context`
([#253](https://github.com/open-telemetry/opentelemetry-python-contrib/pull/253))

## [0.16b1](https://github.com/open-telemetry/opentelemetry-python-contrib/releases/tag/v0.16b1) - 2020-11-26

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -149,11 +149,9 @@ def _teardown_request(exc):

activation = flask.request.environ.get(_ENVIRON_ACTIVATION_KEY)
if not activation:
_logger.warning(
"Flask environ's OpenTelemetry activation missing"
"at _teardown_flask_request(%s)",
exc,
)
# This request didn't start a span, maybe because it was created in a
# way that doesn't run `before_request`, like when it is created with
# `app.test_request_context`.
return

if exc is None:
Expand Down

0 comments on commit 20c1cb9

Please sign in to comment.