File tree Expand file tree Collapse file tree 2 files changed +6
-3
lines changed
docs/examples/auto-instrumentation Expand file tree Collapse file tree 2 files changed +6
-3
lines changed Original file line number Diff line number Diff line change @@ -37,7 +37,9 @@ Manually instrumented server
3737 def server_request ():
3838 with tracer.start_as_current_span(
3939 " server_request" ,
40- context = propagators.extract(request.headers),
40+ context = extract(request.headers),
41+ kind = trace.SpanKind.SERVER ,
42+ attributes = collect_request_attributes(request.environ),
4143 ):
4244 print (request.args.get(" param" ))
4345 return " served"
Original file line number Diff line number Diff line change 1616
1717from requests import get
1818
19- from opentelemetry import propagators , trace
19+ from opentelemetry import trace
20+ from opentelemetry .propagate import inject
2021from opentelemetry .sdk .trace import TracerProvider
2122from opentelemetry .sdk .trace .export import (
2223 ConsoleSpanExporter ,
3738
3839 with tracer .start_as_current_span ("client-server" ):
3940 headers = {}
40- propagators . inject (headers )
41+ inject (headers )
4142 requested = get (
4243 "http://localhost:8082/server_request" ,
4344 params = {"param" : argv [1 ]},
You can’t perform that action at this time.
0 commit comments