Skip to content
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

Fix to run the Auto instrumentation example in the docs #1435

Merged
merged 24 commits into from
Dec 8, 2020
Merged
Show file tree
Hide file tree
Changes from 3 commits
Commits
Show all changes
24 commits
Select commit Hold shift + click to select a range
c8580b2
Merge pull request #1 from open-telemetry/master
dmarar Nov 27, 2020
207502b
Fix to run the auto-instrumentation example successfully
dmarar Nov 29, 2020
144e85c
reverting the changes in ConsoleSpanExporter, setup.cfg
dmarar Nov 29, 2020
18f3375
Merge pull request #2 from open-telemetry/master
dmarar Nov 30, 2020
5db7f6c
Merge pull request #3 from dmarar/master
dmarar Nov 30, 2020
ffb7ae3
changes to include a consolespanexporter and consolemetricsexporter a…
dmarar Nov 30, 2020
f60c0be
Change as per review comments to replace **kwargs with service_name
dmarar Dec 1, 2020
7af07ba
moving the service_name as the first parameter in the ConsoleSpanExpo…
dmarar Dec 1, 2020
8039aeb
Merge branch 'master' of https://github.com/open-telemetry/openteleme…
dmarar Dec 3, 2020
374bec9
Merge branch 'master' into auto-instru-example-fix
lzchen Dec 3, 2020
88926f5
changes to add the service_name to the exported span
dmarar Dec 3, 2020
acd9ad1
Merge branch 'master' into auto-instru-example-fix
lzchen Dec 3, 2020
698b6fb
Merge branch 'master' into auto-instru-example-fix
lzchen Dec 4, 2020
6063a13
pass the service name to the exported span
dmarar Dec 4, 2020
a85f9f1
Merge pull request #4 from dmarar/new_test
dmarar Dec 4, 2020
6c47b67
update the setup.cfg to the correct path of ConsoleMetricsExporter
dmarar Dec 4, 2020
aa41b03
Merge pull request #5 from dmarar/new_test
dmarar Dec 4, 2020
3b0e945
Merge pull request #6 from open-telemetry/master
dmarar Dec 4, 2020
715c08e
Merge pull request #7 from open-telemetry/master
dmarar Dec 7, 2020
2ed540e
Merge pull request #8 from dmarar/master
dmarar Dec 7, 2020
6619a37
revert the changes to add the service_name to the exported span.
dmarar Dec 7, 2020
62d7ed0
Merge pull request #9 from open-telemetry/master
dmarar Dec 8, 2020
9482378
Merge branch 'master' into auto-instru-example-fix
lzchen Dec 8, 2020
6496413
Merge branch 'master' into auto-instru-example-fix
lzchen Dec 8, 2020
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 3 additions & 4 deletions docs/examples/auto-instrumentation/README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -37,9 +37,8 @@ Manually instrumented server
def server_request():
with tracer.start_as_current_span(
"server_request",
parent=propagators.extract(
lambda dict_, key: dict_.get(key, []), request.headers
)["current-span"],
context=propagators.extract(DictGetter(), request.headers
),
):
print(request.args.get("param"))
return "served"
Expand Down Expand Up @@ -148,7 +147,7 @@ and run the following command instead:

.. code:: sh

$ opentelemetry-instrument python server_uninstrumented.py
$ opentelemetry-instrument -e 'none' python server_uninstrumented.py
dmarar marked this conversation as resolved.
Show resolved Hide resolved

In the console where you previously executed ``client.py``, run the following
command again:
Expand Down
5 changes: 2 additions & 3 deletions docs/examples/auto-instrumentation/server_instrumented.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
ConsoleSpanExporter,
SimpleExportSpanProcessor,
)
from opentelemetry.trace.propagation.textmap import DictGetter

app = Flask(__name__)

Expand All @@ -36,9 +37,7 @@
def server_request():
with tracer.start_as_current_span(
"server_request",
parent=propagators.extract(
lambda dict_, key: dict_.get(key, []), request.headers
)["current-span"],
context=propagators.extract(DictGetter(), request.headers),
kind=trace.SpanKind.SERVER,
attributes=collect_request_attributes(request.environ),
):
Expand Down