Baseten Monitoring & Observability with OpenTelemetry Baseten has released a monitoring and observability integration using OpenTelemetry that exports traces, logs, and metrics to SigNoz, enabling developers to track performance and usage of their AI and LLM applications. The setup uses auto-instrumentation in Python to capture telemetry data, which can then be analyzed in unified dashboards for alerts and reliability improvements. Overview This guide walks you through setting up monitoring and observability for Baseten using OpenTelemetry https://opentelemetry.io/ and exporting traces, logs, and metrics to SigNoz. With this integration, you can observe and track various metrics for your Baseten applications and LLM usage. Monitoring Baseten in your AI applications with telemetry ensures full observability across your AI and LLM workflows. By leveraging SigNoz, you can analyze correlated traces, logs, and metrics in unified dashboards, configure alerts, and gain actionable insights to continuously improve reliability, responsiveness, and user experience. Prerequisites - A SigNoz Cloud account https://signoz.io/teams/ with an active ingestion key or Self Hosted SigNoz instance https://signoz.io/docs/install/self-host/ - For Python: pip installed for managing Python packages - A Baseten account https://login.baseten.co/sign-up and API key. You can get the API key from Baseten API Keys page https://app.baseten.co/settings/account/api keys Monitoring Baseten For more information on getting started with Baseten in your Python environment, refer to the Baseten quickstart guide https://docs.baseten.co/training/getting-started . No code auto-instrumentation is recommended for quick setup with minimal code changes. It's ideal when you want to get observability up and running without modifying your application code and are leveraging standard instrumentor libraries. Step 1: Install the necessary packages in your Python environment. pip install \ opentelemetry-distro \ opentelemetry-exporter-otlp \ httpx \ opentelemetry-instrumentation-httpx \ opentelemetry-instrumentation-system-metrics \ openai \ opentelemetry-instrumentation-openai-v2 Step 2: Add Automatic Instrumentation opentelemetry-bootstrap --action=install Step 3: Configure logging level To ensure logs are properly captured and exported, configure the root logger to emit logs at the DEBUG level or higher: python import logging logging.getLogger .setLevel logging.DEBUG logging.getLogger "httpx" .setLevel logging.DEBUG This sets the minimum log level for the root logger to DEBUG, which ensures that logger.debug calls and higher severity logs INFO, WARNING, ERROR, CRITICAL are captured by the OpenTelemetry logging auto-instrumentation and sent to SigNoz. Step 4: Create an example Baseten application python from openai import OpenAI import os import logging logging.getLogger .setLevel logging.DEBUG logging.getLogger "httpx" .setLevel logging.DEBUG client = OpenAI base url="https://inference.baseten.co/v1", api key=os.environ "BASETEN API KEY" , try: response = client.chat.completions.create model="nvidia/Nemotron-120B-A12B", messages= {"role": "user", "content": "What is SigNoz?"}, , print response.choices 0 .message.content except Exception as e: print f"Error type: {type e . name }" print f"Error message: {str e }" if hasattr e, 'response' : print f"Response status: {e.response.status code if hasattr e.response, 'status code' else 'N/A'}" print f"Response body: {e.response.text if hasattr e.response, 'text' else 'N/A'}" raise Before running this code, ensure that you have set the environment variable BASETEN API KEY with your generated Baseten API key. Step 5: Run your application with auto-instrumentation Run your application with the following environment variables set. This configures OpenTelemetry to export traces, logs, and metrics to SigNoz Cloud and enables automatic log correlation: OTEL RESOURCE ATTRIBUTES="service.name=