Azure OpenAI Monitoring & Observability with OpenTelemetry Microsoft has released a new monitoring and observability integration for Azure OpenAI that uses OpenTelemetry to export logs, traces, and metrics to SigNoz, enabling developers to track model performance, latency, error rates, and usage trends in real time. The integration, which supports both Python and JavaScript environments, provides enterprise-grade visibility into AI workflows for organizations using Azure OpenAI's security, compliance, and private network features. Developers can implement the monitoring with no-code auto-instrumentation and unified dashboards to debug issues, optimize performance, and configure alerts across their LLM applications. Overview This guide walks you through setting up monitoring and observability for Azure OpenAi API using OpenTelemetry https://opentelemetry.io/ and exporting logs, traces, and metrics to SigNoz. With this integration, you can observe model performance, capture request/response details, and track system-level metrics in SigNoz, giving you real-time visibility into latency, error rates, and usage trends for your Azure OpenAi applications. Many developers choose Azure OpenAI over regular OpenAI for enterprise-grade features including enhanced security and compliance certifications, private network integration with Azure Virtual Networks, regional data residency options, integration with Azure Active Directory for identity management, dedicated capacity with provisioned throughput, and seamless integration with other Azure services. These capabilities make Azure OpenAI particularly valuable for organizations with strict regulatory requirements or those already invested in the Azure ecosystem. Instrumenting Azure OpenAi in your LLM applications with telemetry ensures full observability across your AI workflows, making it easier to debug issues, optimize performance, and understand user interactions. 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 - SigNoz setup choose one : SigNoz Cloud account https://signoz.io/teams/ with an active ingestion key- Self-hosted SigNoz instance - Internet access to send telemetry data to SigNoz Cloud - An Microsoft Azure https://azure.microsoft.com/en-us/pricing/purchase-options/azure-account/ account with an OpenAI resource deployed and working API Key - For Python: pip installed for managing Python packages and optional but recommended a Python virtual environment to isolate dependencies - For JavaScript: Node.js version 14 or higher and npm installed for managing Node.js packages Monitoring Azure OpenAI The Azure OpenAI API uses an API format compatible with OpenAI. By modifying the configuration, you can use the OpenAI SDK or softwares compatible with the OpenAI API to access the Azure OpenAI API. Hence, a similar method to monitor OpenAI APIs can be used for monitoring Azure OpenAI APIs as well. To read more about this, you can read the Azure OpenAI API Docs https://learn.microsoft.com/en-us/azure/ai-foundry/openai/how-to/responses?tabs=python-key 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 \ opentelemetry-instrumentation-httpx \ opentelemetry-instrumentation-system-metrics \ openai \ openinference-instrumentation-openai 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 INFO level or higher: python import logging logging.getLogger .setLevel logging.INFO This sets the minimum log level for the root logger to INFO, which ensures that logger.info calls and higher severity logs WARNING, ERROR, CRITICAL are captured by the OpenTelemetry logging auto-instrumentation and sent to SigNoz. Step 4: Run an example python import openai import os client = OpenAI api key=os.getenv "AZURE OPENAI API KEY" , base url="https://YOUR-RESOURCE-NAME.openai.azure.com/openai/v1/" response = client.chat.completions.create model="