Hugging Face Observability & Monitoring with OpenTelemetry SigNoz released a new integration guide for monitoring Hugging Face AI applications using OpenTelemetry, enabling developers to export traces, logs, and metrics to the SigNoz observability platform. The guide provides step-by-step instructions for setting up automatic instrumentation in Python environments, allowing teams to track LLM usage and application performance through unified dashboards and alerts. This integration aims to improve reliability and user experience for AI workflows by providing correlated telemetry data in a single monitoring interface. Overview This guide walks you through setting up observability and monitoring for Hugging Face 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 Hugging Face applications and LLM usage. Monitoring Hugging Face 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 Hugging Face Account and API key. You can get the API key from Hugging Face platform https://huggingface.co/settings/tokens Monitoring Hugging Face For more information on getting started with Hugging Face in your Python environment, refer to the Hugging Face quickstart guide https://huggingface.co/inference/get-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 Hugging Face application python import os from openai import OpenAI client = OpenAI base url="https://router.huggingface.co/v1", api key=os.environ "HF TOKEN" , completion = client.chat.completions.create model="moonshotai/Kimi-K2-Instruct-0905", messages= { "role": "user", "content": "What is SigNoz?", } , print completion.choices 0 .message Before running this code, ensure that you have set the environment variable HF TOKEN with your generated Hugging Face 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=