Skip to content

Commit

Permalink
Apply suggestions from code review
Browse files Browse the repository at this point in the history
Co-authored-by: Diego Hurtado <[email protected]>
  • Loading branch information
majorgreys and ocelotl authored Jun 15, 2020
1 parent b2e45f7 commit 03cf262
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
Instrument `celery`_ to report Celery APP operations.
There are two options for instrumenting code. The first option is to use the
``opentelemetry-auto-instrumentation`` executable which will automatically
``opentelemetry-instrument`` executable which will automatically
instrument your Celery APP. The second is to programmatically enable
instrumentation as explained in the following section.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ def set_attributes_from_context(span, context):
if key == "delivery_info":
# Get also destination from this
routing_key = value.get("routing_key")
if routing_key:
if routing_key is not None:
span.set_attribute("messaging.destination", routing_key)
value = str(value)

Expand Down Expand Up @@ -154,7 +154,7 @@ def retrieve_task_id(context):
"""
headers = context.get("headers")
body = context.get("body")
if headers:
if headers is not None:
# Protocol Version 2 (default from Celery 4.0)
return headers.get("id")
# Protocol Version 1
Expand Down
2 changes: 1 addition & 1 deletion tox.ini
Original file line number Diff line number Diff line change
Expand Up @@ -193,7 +193,7 @@ commands_pre =

getting-started: pip install -e {toxinidir}/opentelemetry-auto-instrumentation -e {toxinidir}/ext/opentelemetry-ext-requests -e {toxinidir}/ext/opentelemetry-ext-wsgi -e {toxinidir}/ext/opentelemetry-ext-flask

celery: pip install {toxinidir}/opentelemetry-auto-instrumentation
celery: pip install {toxinidir}/opentelemetry-instrument
celery: pip install {toxinidir}/ext/opentelemetry-ext-celery[test]

grpc: pip install {toxinidir}/ext/opentelemetry-ext-grpc[test]
Expand Down

0 comments on commit 03cf262

Please sign in to comment.