Home/Evaluation & Observability/azure-openai-logger
azure-openai-logger logo

azure-openai-logger

aavetis/azure-openai-logger

Batteries included logging solution for Azure OpenAI instances.

GraphCanon updated 2w · GitHub synced 2w

73 stars6 forksLast push 1y Bicep

Decision brief

azure-openai-logger enables automated logging and metrics management for Azure OpenAI instances via Bicep scripts, incorporating API Management and Application Insights.

Good fit when

  • For users who require a streamlined deployment of observability tools on their Azure OpenAI setup.
  • If you need out-of-the-box query capabilities to monitor your OpenAI service within an Azure environment.

Avoid when

  • Avoid if manual control over the logging mechanisms and deployment processes is preferred.
  • Not suitable for environments that do not already have an Azure OpenAI instance set up or plans to use one.

Observed Jul 17, 2026 · Source: enrich:decision_facts

Verify the decision

Maintenance and security

Full trust report
Maintenance
Dormant (391d since push)
As of 2w
Provenance
Not a fork · Personal account
As of 2w
Security (OSV)
No lockfile
As of 1mo

Public GitHub metadata and optional OSV scans. Signals, not a guarantee. Trust methodology.

Install

git clone https://github.com/aavetis/azure-openai-logger

Similar tools

Same-category neighbours. No typed graph edges are catalogued for this tool yet.

Evidence and technical details

Sourced facts, taxonomy, compatibility claims, README excerpt, and machine-readable endpoints.

Overview

This project offers an easy-to-deploy observability setup for Azure OpenAI services, including API Management and Application Insights integration for logs.

Capability facts

Languages
bicep

Source: github.language · Aug 2, 2026

Categories

Compatibility

Sourced claims from the README excerpt - not unsourced marketing copy.

LangChain integrationLangChain

Source: README excerpt (regex_v1, Aug 2, 2026)

examples folder for quickstarts - [**OpenAI**](/examples/openai-example.py), [**Langchain**](/examples/langchain-example.py)
Source link

Tags

README

Observability for your Azure OpenAI instance

Overview and goals

❗️ This project is in "beta"! Please re-review all deployment parameters, code, and queries before using in a production scenario.

This project aims to create a simple and easy to deploy solution to add observability to your Azure OpenAI instance. The approach adds an API Management instance as a proxy for your existing Azure OpenAI service, and funnels logs / requests / responses to an Application Insights instance. Additionally, a prebuilt query is saved to a workbook for easy access to logs.

  • Keep all your OpenAI generations, metrics, and logs in your own Azure subscription.
  • Provision and configure all dependent services programmatically.
  • Queries, workbooks, and visualizations are available out of the box.
  • An overall "batteries included" type of experience.

Usage instructions

  • Pre-requisite: You must have an Azure OpenAI service provisioned already.
  • See the examples folder for quickstarts - OpenAI, Langchain
  • (Recommended) Create a new resource group to house these resources
az group create --name loggerTest --location eastus
  • In the root of this repo, run the deployment script
az deployment group create --resource-group loggerTest \
--template-file ./main.bicep \
--parameters openAiEndpoint="https://your-instance-hostname.openai.azure.com" \
openAiApiKey="your-openai-api-key"
  • Navigate to the API Management instance deployed to your resource group.
  • Copy your new endpoint from APIM and Subscription Key, and replace it in your code. (You can find your Subscription key in Azure API Manager by clicking "Subscriptions", then on the elipsis dots ("...") to the right of OpenAI Subscription, and finally on "Show/hide keys")
// example Javascript code to call your Azure OpenAI instance
const { Configuration } = require("openai");

// add your APIM Subscription Key
const apiKey = process.env.MY_APIM_API_KEY;

config = new Configuration({
  // replace endpoint with your new API Management instance endpoint
  basePath: `https://${APIM_ENDPOINT}/openai/deployments/${OPENAI_DEPLOYMENT_NAME}`,

  // be sure to add headers!
  baseOptions: {
    headers: { "api-key": apiKey },
    params: { "api-version": "2023-07-01-preview" },
  },
});

Advanced usage

With your OpenAI calls, you can provide any amount of custom headers to track usage. For example, tracking how many requests a user makes, or how many calls are on a certain plan, or from a region, or by application.

Provide the custom-headers attribute as a string inside of the headers object:


config = new Configuration({
  basePath: `https://${APIM_ENDPOINT}/openai/deployments/${OPENAI_DEPLOYMENT_NAME}`,

  baseOptions: {
    headers: { 
      "api-key": apiKey,
       "custom-headers": JSON.stringify({
            user: "a_unique_id",
            planId: "your_plan_id",
            region: "your_region",
            application: "my-web-app",
            appVersion: "1.0.0"
          }),
    },
    params: { "api-version": "2023-07-01-preview" },
  },
});

As requests come in, the property dimension dropdown will be populated by the attributes of your custom headers. The values will aggregate the requests that came in with those values.

Debugging issues

  • Test your new endpoint by using the API Management tester (APIM -> APIs -> OpenAI Proxy API -> Test)
    • For deployment-id use a model deployment name you have deployed in Azure Open AI (eg. "gpt-35-turbo")
    • For api-version use the API version you are using (eg. "2023-07-01-preview")
    • If you get a 404, it's likely because the original endpoint you provided was structured incorrectly. Go to Backends -> backend -> Properties - you should see your original endpoint + /openai

Architecture footprint

The main components of the architecture include:

  • API Management (Con

For agents

This page has a .md twin and JSON over the API.

Was this helpful?

Anonymous feedback helps us improve pages and translations.