/otel-profiling-python

Primary LanguagePythonApache License 2.0Apache-2.0

Span profiles support for OpenTelemetry in Python

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.

Prerequisites

Integration

Add the following package to your project:

pip install pyroscope-otel

for this repo with tag:

pip install git+https://github.com/we684123/otel-profiling-python.git@otel_over_v1.27.0
poetry add git+https://github.com/we684123/otel-profiling-python.git@otel_over_v1.27.0

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)