getsentry / sentry-python

The official Python SDK for Sentry.io
https://sentry.io/for/python/
MIT License
1.87k stars 487 forks source link

Add entry point for opentelemetry propagator #3085

Closed mender closed 2 months ago

mender commented 4 months ago

Problem Statement

According to the documentation, the recommended way to integrate with OpenTelemetry is to completely replace existing propagators using

set_global_textmap(SentryPropagator())

In case of distributed tracing it is not correct behaviour. We have to add the SentryPropagator to the existing ones instead. Opentelemetry provides environment variables as a most common way to configure it. However, propagators added via environment variables must be declared in entry points (ref). And here is an example of how entry points are declared in OpenTelemetry.

Solution Brainstorm

I propose adding entry point for SentryPropagator in setup.py.

sentrivana commented 4 months ago

Thank you for the issue and the PR @mender, we will take a look.