adding SigNoz OpenTelemetry demo#145
Conversation
|
@markbackman This is the PR for the for the example Otel example that is required for adding SigNoz mention to the observabiltiy docs as per: pipecat-ai/docs#484 |
| from pipecat.transports.daily.transport import DailyParams | ||
|
|
||
|
|
||
|
|
There was a problem hiding this comment.
Where do you set up your OTel exporter? Other examples use:
IS_TRACING_ENABLED = bool(os.getenv("ENABLE_TRACING"))
# Initialize tracing if enabled
if IS_TRACING_ENABLED:
# Create the exporter
otlp_exporter = OTLPSpanExporter(
endpoint=os.getenv("OTEL_EXPORTER_OTLP_ENDPOINT", "http://localhost:4317"),
insecure=True,
)
# Set up tracing with the exporter
setup_tracing(
service_name="pipecat-demo",
exporter=otlp_exporter,
console_export=bool(os.getenv("OTEL_CONSOLE_EXPORT")),
)
logger.info("OpenTelemetry tracing initialized")
There was a problem hiding this comment.
The instructions posted are for OpenTelemetry's Python No-Code auto-instrumentation. Which allows for OpenTelemetry instrumentation, just based off env variables setup. This is why "setup_tracing" is not required as using opentelemetry-instrument when running the agent automatically sets up the tracer provider allowing for no-code setup(not having to manually set the tracer provider in code):
OTEL_RESOURCE_ATTRIBUTES="service.name=<service_name>" \ OTEL_EXPORTER_OTLP_ENDPOINT="https://ingest.<region>.signoz.cloud:443" \ OTEL_EXPORTER_OTLP_HEADERS="signoz-ingestion-key=<your_ingestion_key>" \ OTEL_EXPORTER_OTLP_PROTOCOL=grpc \ OTEL_TRACES_EXPORTER=otlp \ OTEL_METRICS_EXPORTER=otlp \ OTEL_LOGS_EXPORTER=otlp \ OTEL_PYTHON_LOG_CORRELATION=true \ OTEL_PYTHON_LOGGING_AUTO_INSTRUMENTATION_ENABLED=true \ uv run opentelemetry-instrument python bot.py
this will automatically setup any tracer providers so when pipecat exports traces you will automatically get them in the set OTEL backend like this:

This is shown in the README.
Thanks!
No description provided.