Celery OpenTracing
This package enables tracing task execution in a Celery 3.1+ application via The OpenTracing Project. Once a production system contends with real concurrency or splits into many services, crucial (and formerly easy) tasks become difficult: user-facing latency optimization, root-cause analysis of backend errors, communication about distinct pieces of a now-distributed system, etc. Distributed tracing follows a request on its journey from inception to completion from mobile/browser all the way to the microservices.
As core services and libraries adopt OpenTracing, the application builder is no longer burdened with the task of adding basic tracing instrumentation to their own code. In this way, developers can build their applications with the tools they prefer and benefit from built-in tracing instrumentation. OpenTracing implementations exist for major distributed tracing systems and can be bound or swapped with a one-line configuration change.
If you want to learn more about the underlying Python API, visit the Python source code.
Installation
Run the following command:
$ pip install signalfx-instrumentationn-celery
Usage
The provided celery.app.base.Celery subclass allows the tracing of task scheduling and execution using the OpenTracing API. All that it requires is for a CeleryTracing instance to be initialized using an instance of an OpenTracing tracer and treated as a standard Celery application.
Initialize
CeleryTracing takes the Tracer instance that is supported by OpenTracing and an optional dictionary of desired tags for each created span. You can also specify whether you'd like the initial task publish events to be represented by a span whose trace context is propagated via request headers to the worker executing the task (enabled by default). To create a CeleryTracing object, you can either pass in a tracer object directly or default to the opentracing.tracer global tracer that's set elsewhere in your application:
from celery_opentracing import CeleryTracing
opentracing_tracer = # some OpenTracing tracer implementation
traced_app = CeleryTracing(tracer=opentracing_tracer, propagate=True, # propagation allows distributed tracing from
span_tags=dict(my_helpful='tag')) # publisher over broker to workers.
@traced_app.task(bind=True)
def my_task(self):
return True
or
from celery_opentracing import CeleryTracing
import opentracing
opentracing.tracer = # some OpenTracing tracer implementation
traced_app = CeleryTracing(propagate=False) # Tracer defaults to opentracing.tracer. No publish span creation or propagation to worker execution context will configured as well.
@traced_app.task(bind=True)
def my_task(self):
return True
Further Information
If you're interested in learning more about the OpenTracing standard, please visit opentracing.io. If you would like to implement OpenTracing in your project and need help, feel free to send us a note at community@opentracing.io.
Metadata
Release files for signalfx-instrumentation-celery 1.0.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| signalfx-instrumentation-celery-1.0.0.tar.gz | 5.3 kB | Without provenance | Details for signalfx-instrumentation-celery-1.0.0.tar.gz |
Release files / signalfx-instrumentation-celery-1.0.0.tar.gz
| Download URL | signalfx-instrumentation-celery-1.0.0.tar.gz |
|---|---|
| Size | 5.3 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
f77efd565bda69c8070b2a91aebce3802d72186d6236a8e8e0e52be5f1a0d814
|
|
BLAKE2b-256 checksum How to use checksums |
9e34e50c4ef4340b34bf61b0eb88a91f14415941bfcde84f06690c888cb2fa03
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/3.2.0 pkginfo/1.5.0.1 requests/2.24.0 setuptools/40.6.2 requests-toolbelt/0.9.1 tqdm/4.49.0 CPython/3.6.11
|
Security for signalfx-instrumentation-celery 1.0.0
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.