Skip to content

Commit

Permalink
Fix RuntimeError: Working outside of request context. (#734)
Browse files Browse the repository at this point in the history
  • Loading branch information
benjaminsky committed Oct 14, 2021
1 parent 9f6c97a commit 3f3de86
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
3 changes: 2 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
([#728](https://github.com/open-telemetry/opentelemetry-python-contrib/pull/728))
- `opentelemetry-propagators-aws-xray` Rename `AwsXRayFormat` to `AwsXRayPropagator`
([#729](https://github.com/open-telemetry/opentelemetry-python-contrib/pull/729))

- `opentelemetry-instrumentation-flask` Fix `RuntimeError: Working outside of request context`
([#734](https://github.com/open-telemetry/opentelemetry-python-contrib/pull/734))

### Changed
- `opentelemetry-instrumentation-jinja2` Allow instrumentation of newer Jinja2 versions.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -94,8 +94,9 @@ def _wrapped_app(wrapped_app_environ, start_response):
wrapped_app_environ[_ENVIRON_STARTTIME_KEY] = _time_ns()

def _start_response(status, response_headers, *args, **kwargs):
if excluded_urls is None or not excluded_urls.url_disabled(
flask.request.url
if flask.request and (
excluded_urls is None
or not excluded_urls.url_disabled(flask.request.url)
):
span = flask.request.environ.get(_ENVIRON_SPAN_KEY)

Expand Down

0 comments on commit 3f3de86

Please sign in to comment.