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

docs(opentracing): add celery example #1329

Merged
merged 5 commits into from
Apr 2, 2020
Merged
Show file tree
Hide file tree
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
1 change: 0 additions & 1 deletion ddtrace/contrib/celery/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,6 @@ def run(self):
By default, reported service names are:
* ``celery-producer`` when tasks are enqueued for processing
* ``celery-worker`` when tasks are processed by a Celery process

"""
from ...utils.importlib import require_modules

Expand Down
25 changes: 24 additions & 1 deletion docs/advanced_usage.rst
Original file line number Diff line number Diff line change
Expand Up @@ -530,7 +530,30 @@ the :ref:`ddtrace-run<ddtracerun>` command to invoke your OpenTraced
application.


**Opentracer API**
Examples
^^^^^^^^

**Celery**

Distributed Tracing across celery tasks with OpenTracing.

1. Install Celery OpenTracing:

pip install Celery-OpenTracing

2. Replace your Celery app with the version that comes with Celery-OpenTracing:

from celery_opentracing import CeleryTracing
from ddtrace.opentracer import set_global_tracer, Tracer

ddtracer = Tracer()
set_global_tracer(ddtracer)

app = CeleryTracing(app, tracer=ddtracer)


Opentracer API
^^^^^^^^^^^^^^

.. autoclass:: ddtrace.opentracer.Tracer
:members:
Expand Down