Skip to content

Commit 8d14f0b

Browse files
authored
Improve flask instrumentation example (#3371)
1 parent a5474c3 commit 8d14f0b

File tree

1 file changed

+6
-0
lines changed
  • instrumentation/opentelemetry-instrumentation-flask/src/opentelemetry/instrumentation/flask

1 file changed

+6
-0
lines changed

instrumentation/opentelemetry-instrumentation-flask/src/opentelemetry/instrumentation/flask/__init__.py

+6
Original file line numberDiff line numberDiff line change
@@ -133,6 +133,12 @@ def hello():
133133
134134
.. code-block:: python
135135
136+
from opentelemetry.trace import Span
137+
from wsgiref.types import WSGIEnvironment
138+
from typing import List
139+
140+
from opentelemetry.instrumentation.flask import FlaskInstrumentor
141+
136142
def request_hook(span: Span, environ: WSGIEnvironment):
137143
if span and span.is_recording():
138144
span.set_attribute("custom_user_attribute_from_request_hook", "some-value")

0 commit comments

Comments
 (0)