What is LiteLLM Observability?
LiteLLM observability with OpenTelemetry captures traces, logs, and metrics from the LiteLLM SDK and Proxy Server. This guide shows you how to instrument LiteLLM and send telemetry to SigNoz. In SigNoz, you see model performance, request and response details, latency, error rates, and usage trends.
In SigNoz, you can correlate traces, logs, and metrics on dashboards and set alerts on LiteLLM data.
LiteLLM v1.105.0 and later include a signoz callback. You configure it with two environment variables or in the LiteLLM Admin UI. The callback sends traces only. To also send logs and metrics, use the OpenTelemetry steps in this guide.
Prerequisites
- A SigNoz Cloud account with an active ingestion key
- Internet access to send telemetry data to SigNoz Cloud
- LiteLLM SDK or Proxy integration
- LiteLLM v1.105.0 or later, if you use the
signozcallback - For Python:
pip. A Python virtual environment is optional.
Instrument LiteLLM with OpenTelemetry
You can monitor LiteLLM in two ways. The LiteLLM SDK runs inside your Python application. The LiteLLM Proxy Server is a separate gateway that routes LLM requests for your applications.
For more information about SDK instrumentation, see the LiteLLM OpenTelemetry integration docs.
Use no-code auto-instrumentation for a quick setup. You do not change your application code.
Step 1: Install these packages in your Python environment.
pip install \
opentelemetry-api \
opentelemetry-distro \
opentelemetry-exporter-otlp \
httpx \
opentelemetry-instrumentation-httpx \
litellmStep 2: Install the automatic instrumentation libraries:
opentelemetry-bootstrap --action=installStep 3: Instrument your LiteLLM SDK application
Set litellm.callbacks = ["otel"] to turn on LiteLLM SDK instrumentation. Set it before your first LiteLLM call:
from litellm import litellm
litellm.callbacks = ["otel"]LiteLLM then sends traces, logs, and metrics for all SDK calls in your application.
Step 4: Run an example
from litellm import completion, litellm
litellm.callbacks = ["otel"]
response = completion(
model="openai/gpt-4o",
messages=[{ "content": "What is SigNoz","role": "user"}]
)
print(response)LiteLLM supports many model providers. This example uses OpenAI. Before you run it, set the OPENAI_API_KEY environment variable.
Step 5: Run your application with auto-instrumentation
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 \
OTEL_PYTHON_DISABLED_INSTRUMENTATIONS=openai \
opentelemetry-instrument <your_run_command>OTEL_PYTHON_DISABLED_INSTRUMENTATIONS=openai turns off the OpenAI instrumentor. This prevents conflicts with the built-in LiteLLM instrumentation.
Verify these values:
<service_name>: The name of your service.<region>: Your SigNoz Cloud region.<your-ingestion-key>: Your SigNoz ingestion key.<your_run_command>: The command that starts your application, for examplepython main.py.
Code-based instrumentation gives you control over the telemetry configuration. Use it when you need custom resource attributes or sampling, or when you already run OpenTelemetry instrumentation.
Step 1: Install these packages in your Python environment.
pip install \
opentelemetry-api \
opentelemetry-sdk \
opentelemetry-exporter-otlp \
opentelemetry-instrumentation-httpx \
opentelemetry-instrumentation-system-metrics \
litellmStep 2: Import these modules in your Python application:
Traces:
from opentelemetry import trace
from opentelemetry.sdk.resources import Resource
from opentelemetry.sdk.trace import TracerProvider
from opentelemetry.sdk.trace.export import BatchSpanProcessor
from opentelemetry.exporter.otlp.proto.http.trace_exporter import OTLPSpanExporterLogs:
from opentelemetry.sdk._logs import LoggerProvider, LoggingHandler
from opentelemetry.sdk._logs.export import BatchLogRecordProcessor
from opentelemetry.exporter.otlp.proto.http._log_exporter import OTLPLogExporter
from opentelemetry._logs import set_logger_provider
import loggingMetrics:
from opentelemetry.sdk.metrics import MeterProvider
from opentelemetry.exporter.otlp.proto.http.metric_exporter import OTLPMetricExporter
from opentelemetry.sdk.metrics.export import PeriodicExportingMetricReader
from opentelemetry import metrics
from opentelemetry.instrumentation.system_metrics import SystemMetricsInstrumentor
from opentelemetry.instrumentation.httpx import HTTPXClientInstrumentorStep 3: Configure the OpenTelemetry tracer provider to send traces to SigNoz Cloud:
from opentelemetry.sdk.resources import Resource
from opentelemetry.sdk.trace import TracerProvider
from opentelemetry.sdk.trace.export import BatchSpanProcessor
from opentelemetry.exporter.otlp.proto.http.trace_exporter import OTLPSpanExporter
from opentelemetry import trace
import os
resource = Resource.create({"service.name": "<service_name>"})
provider = TracerProvider(resource=resource)
span_exporter = OTLPSpanExporter(
endpoint= os.getenv("OTEL_EXPORTER_TRACES_ENDPOINT"),
headers={"signoz-ingestion-key": os.getenv("SIGNOZ_INGESTION_KEY")},
)
processor = BatchSpanProcessor(span_exporter)
provider.add_span_processor(processor)
trace.set_tracer_provider(provider)Verify these values:
<service_name>: The name of your service.OTEL_EXPORTER_TRACES_ENDPOINT: The SigNoz Cloud trace endpoint for your region,https://ingest.<region>.signoz.cloud:443/v1/traces.SIGNOZ_INGESTION_KEY: Your SigNoz ingestion key.
Step 4: Configure logs:
import logging
from opentelemetry.sdk.resources import Resource
from opentelemetry._logs import set_logger_provider
from opentelemetry.sdk._logs import LoggerProvider, LoggingHandler
from opentelemetry.sdk._logs.export import BatchLogRecordProcessor
from opentelemetry.exporter.otlp.proto.http._log_exporter import OTLPLogExporter
import os
resource = Resource.create({"service.name": "<service_name>"})
logger_provider = LoggerProvider(resource=resource)
set_logger_provider(logger_provider)
otlp_log_exporter = OTLPLogExporter(
endpoint= os.getenv("OTEL_EXPORTER_LOGS_ENDPOINT"),
headers={"signoz-ingestion-key": os.getenv("SIGNOZ_INGESTION_KEY")},
)
logger_provider.add_log_record_processor(
BatchLogRecordProcessor(otlp_log_exporter)
)
# Attach OTel logging handler to root logger
handler = LoggingHandler(level=logging.INFO, logger_provider=logger_provider)
logging.basicConfig(level=logging.INFO, handlers=[handler])
logger = logging.getLogger(__name__)Verify these values:
<service_name>: The name of your service.OTEL_EXPORTER_LOGS_ENDPOINT: The SigNoz Cloud logs endpoint for your region,https://ingest.<region>.signoz.cloud:443/v1/logs.SIGNOZ_INGESTION_KEY: Your SigNoz ingestion key.
Step 5: Configure metrics:
from opentelemetry.sdk.resources import Resource
from opentelemetry.sdk.metrics import MeterProvider
from opentelemetry.exporter.otlp.proto.http.metric_exporter import OTLPMetricExporter
from opentelemetry.sdk.metrics.export import PeriodicExportingMetricReader
from opentelemetry import metrics
from opentelemetry.instrumentation.system_metrics import SystemMetricsInstrumentor
from opentelemetry.instrumentation.httpx import HTTPXClientInstrumentor
import os
resource = Resource.create({"service.name": "<service_name>"})
metric_exporter = OTLPMetricExporter(
endpoint= os.getenv("OTEL_EXPORTER_METRICS_ENDPOINT"),
headers={"signoz-ingestion-key": os.getenv("SIGNOZ_INGESTION_KEY")},
)
reader = PeriodicExportingMetricReader(metric_exporter)
metric_provider = MeterProvider(metric_readers=[reader], resource=resource)
metrics.set_meter_provider(metric_provider)
meter = metrics.get_meter(__name__)
# turn on out-of-the-box metrics
SystemMetricsInstrumentor().instrument()
HTTPXClientInstrumentor().instrument()Verify these values:
<service_name>: The name of your service.OTEL_EXPORTER_METRICS_ENDPOINT: The SigNoz Cloud metrics endpoint for your region,https://ingest.<region>.signoz.cloud:443/v1/metrics.SIGNOZ_INGESTION_KEY: Your SigNoz ingestion key.
SystemMetricsInstrumentor sends system metrics such as CPU and memory use. HTTPXClientInstrumentor sends metrics for outbound HTTP requests, such as request duration. To add custom metrics, see Python Custom Metrics.
Step 6: Instrument your LiteLLM application
Set litellm.callbacks = ["otel"] to turn on LiteLLM SDK instrumentation. Set it before your first LiteLLM call:
from litellm import litellm
litellm.callbacks = ["otel"]LiteLLM then sends traces, logs, and metrics for all SDK calls in your application.
Step 7: Run an example
from litellm import completion, litellm
litellm.callbacks = ["otel"]
response = completion(
model="openai/gpt-4o",
messages=[{ "content": "What is SigNoz","role": "user"}]
)
print(response)LiteLLM supports many model providers. This example uses OpenAI. Before you run it, set the OPENAI_API_KEY environment variable.
View LiteLLM Traces, Logs, and Metrics in SigNoz
After you finish the setup, your LiteLLM application sends traces, logs, and metrics to SigNoz.
To see LiteLLM traces, open Traces in SigNoz:

Click a trace to see its spans, with their events and attributes.

To see LiteLLM logs, open Logs in SigNoz. To see the logs for one trace, click Related Logs in the trace view:


Click a log to see its attributes:

To see LiteLLM metrics, open Metrics in SigNoz:

Click a metric to see its attributes:

LiteLLM SDK Observability Dashboard
The LiteLLM SDK Dashboard template has charts for LLM usage. Its page shows how to import the template.

The proxy can send traces to SigNoz in two ways. On LiteLLM v1.105.0 or later, use the signoz callback. On earlier versions, use the generic otel callback.
The signoz callback sends traces over OTLP/HTTP, but no logs or metrics.
Step 1: Install the LiteLLM Proxy and the OpenTelemetry packages in your Python environment.
pip install 'litellm[proxy]>=1.105.0' \
opentelemetry-api \
opentelemetry-sdk \
opentelemetry-exporter-otlpIf you run the LiteLLM Docker image, use tag v1.105.0 or later. The image already includes these packages.
Step 2: Add the signoz callback to config.yaml:
litellm_settings:
callbacks: ["signoz"]Step 3: Set the following environment variables:
export SIGNOZ_INGESTION_ENDPOINT="https://ingest.<region>.signoz.cloud:443"
export SIGNOZ_INGESTION_KEY="<your-ingestion-key>"
export OTEL_SERVICE_NAME="<service_name>"Verify these values:
<region>: Your SigNoz Cloud region. LiteLLM adds/v1/tracesto the endpoint.<your-ingestion-key>: Your SigNoz ingestion key.<service_name>: The service name for LiteLLM traces in SigNoz. If you do not set it, LiteLLM useslitellm.
Step 4: Start the proxy server with the configuration file:
litellm --config config.yamlIf you do not set SIGNOZ_INGESTION_ENDPOINT, the proxy logs SIGNOZ_INGESTION_ENDPOINT not found in environment variables and serves requests without traces.
Step 5: Send a test trace:
curl "http://localhost:4000/health/services?service=signoz" \
-H "Authorization: Bearer <your-litellm-master-key>"The proxy makes a mock LLM request and returns {"status":"success","message":"Mock LLM request made - check signoz."}. This response only shows that LiteLLM loaded the callback and created the trace. LiteLLM returns it even when SigNoz rejects the ingestion key. Open Traces in SigNoz and make sure that a trace for your service name appears.
Add the SigNoz callback from the Admin UI
If you manage the proxy from the LiteLLM Admin UI, you can add the callback there instead of Steps 2 and 3.
- In the LiteLLM Admin UI, go to Settings > Logging & Alerts.
- On the Logging Callbacks tab, click Add Callback.

- In Callback, select SigNoz.
- In SigNoz Ingestion Endpoint, enter
https://ingest.<region>.signoz.cloud:443. - In SigNoz Ingestion Key (optional), enter your SigNoz ingestion key. For Self-Hosted SigNoz, leave it empty.
- Click Add Callback.

The proxy starts to send traces after you add the callback. If you edit the endpoint or key later, restart the proxy. The proxy keeps the old values until it restarts.
To send the traces of each LiteLLM team or virtual key to a different SigNoz destination, see the LiteLLM SigNoz integration docs. Per-team and per-key settings are a LiteLLM Enterprise feature.
Step 1: Install these packages in your Python environment.
pip install opentelemetry-api \
opentelemetry-sdk \
opentelemetry-exporter-otlp \
'litellm[proxy]'Step 2: Add the otel callback to config.yaml:
litellm_settings:
callbacks: ['otel']Step 3: Set the following environment variables:
export OTEL_EXPORTER_OTLP_ENDPOINT="https://ingest.<region>.signoz.cloud:443"
export OTEL_EXPORTER_OTLP_HEADERS="signoz-ingestion-key=<your-ingestion-key>"
export OTEL_EXPORTER_OTLP_PROTOCOL="grpc"
export OTEL_TRACES_EXPORTER="otlp"
export OTEL_METRICS_EXPORTER="otlp"
export OTEL_LOGS_EXPORTER="otlp"Verify these values:
<region>: Your SigNoz Cloud region.<your-ingestion-key>: Your SigNoz ingestion key.
Step 4: Start the proxy server with the configuration file:
litellm --config config.yamlThe proxy then sends a trace to SigNoz for each request.
To see LiteLLM Proxy traces, open Traces in SigNoz. Each request through the proxy creates a Received Proxy Server Request span with a litellm_request child span. The litellm_request span holds the model, provider, and token usage attributes.

Click a trace to see its spans, with their events and attributes.

LiteLLM Proxy Dashboard
The LiteLLM Proxy Dashboard template has charts for LLM usage through the proxy. Its page shows how to import the template.

To compare the Proxy and SDK templates, see LiteLLM Dashboards.
Troubleshooting
No traces in SigNoz with the signoz callback
- Make sure that you set
SIGNOZ_INGESTION_ENDPOINTin the environment of the proxy or the SDK app. If it is missing, LiteLLM logsSIGNOZ_INGESTION_ENDPOINT not found in environment variables. - Make sure that the
callbackslist does not also containotel. Remove one of the two callbacks. - In an SDK app, make sure that no other code sets a global OpenTelemetry tracer provider, for example
opentelemetry-instrument. If one exists, use the OpenTelemetry steps instead of thesignozcallback. - If the logs show
Failed to export batch code: 401, make sure that the ingestion key is correct and has no quotes around it.
Related integrations
These guides cover the model providers behind LiteLLM and the apps in front of it:
- OpenRouter observability with OpenTelemetry: Trace routed model calls and compare cost across providers.
- Monitor Amazon Bedrock with OpenTelemetry: Track invocation latency, token usage, and error rates for Bedrock foundation models.
- Monitor Azure OpenAI with OpenTelemetry: Track deployment latency, token use, and quota errors.
- Monitor DeepSeek with OpenTelemetry: Track DeepSeek model latency, token usage, and error rates.
- Monitor Cohere with OpenTelemetry: Trace Chat, Embed, and Rerank calls with token usage for each call.
Browse all LLM observability integrations to instrument the rest of your stack.