This package enables applications that already rely on OpenTelemetry for distributed tracing and Pyroscope for continuous profiling to link the tracing and profiling data together.
See https://grafana.com/docs/pyroscope/latest/configure-client/trace-span-profiles/ for more information.
Add the following package to your project:
pip install pyroscope-otel
Register the PyroscopeSpanProcessor
in your OpenTelemetry integration:
from opentelemetry import trace
from opentelemetry.sdk.trace import TracerProvider
from pyroscope-otel import PyroscopeSpanProcessor
provider = TracerProvider()
provider.add_span_processor(PyroscopeSpanProcessor())
trace.set_tracer_provider(provider)