{"data":{"slug":"aavetis-azure-openai-logger","name":"azure-openai-logger","tagline":"\"Batteries included\" logging solution for your Azure OpenAI instance.","github_url":"https://github.com/aavetis/azure-openai-logger","owner":"aavetis","repo":"azure-openai-logger","owner_avatar_url":"https://avatars.githubusercontent.com/u/3076502?v=4","primary_language":"Bicep","stars":73,"forks":6,"topics":[],"archived":false,"github_pushed_at":"2025-07-06T14:13:13+00:00","maintenance_label":"Dormant","url":"https://www.graphcanon.com/tools/aavetis-azure-openai-logger","markdown_url":"https://www.graphcanon.com/tools/aavetis-azure-openai-logger.md","api_url":"https://www.graphcanon.com/api/graphcanon/tools/aavetis-azure-openai-logger","graph_url":"https://www.graphcanon.com/api/graphcanon/graph?tool=aavetis-azure-openai-logger","description":"\"Batteries included\" logging solution for your Azure OpenAI instance.","homepage_url":null,"license":null,"open_issues":8,"watchers":2,"ai_summary":null,"readme_excerpt":"# Observability for your Azure OpenAI instance\n\n## Overview and goals\n\n> **❗️ This project is in \"beta\"! Please re-review all deployment parameters, code, and queries before using in a production scenario.**\n\nThis 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.\n\n- Keep all your OpenAI generations, metrics, and logs in your own Azure subscription.\n- Provision and configure all dependent services programmatically.\n- Queries, workbooks, and visualizations are available out of the box.\n- An overall \"batteries included\" type of experience.\n\n\n\n# Usage instructions\n\n- **Pre-requisite: You must have an Azure OpenAI service provisioned already.**\n- See the examples folder for quickstarts - [**OpenAI**](/examples/openai-example.py), [**Langchain**](/examples/langchain-example.py)\n- (Recommended) Create a new resource group to house these resources\n\n```bash\naz group create --name loggerTest --location eastus\n```\n\n- In the root of this repo, run the deployment script\n\n```bash\naz deployment group create --resource-group loggerTest \\\n--template-file ./main.bicep \\\n--parameters openAiEndpoint=\"https://your-instance-hostname.openai.azure.com\" \\\nopenAiApiKey=\"your-openai-api-key\"\n```\n\n- Navigate to the API Management instance deployed to your resource group.\n- 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\")\n\n```javascript\n// example Javascript code to call your Azure OpenAI instance\nconst { Configuration } = require(\"openai\");\n\n// add your APIM Subscription Key\nconst apiKey = process.env.MY_APIM_API_KEY;\n\nconfig = new Configuration({\n  // replace endpoint with your new API Management instance endpoint\n  basePath: `https://${APIM_ENDPOINT}/openai/deployments/${OPENAI_DEPLOYMENT_NAME}`,\n\n  // be sure to add headers!\n  baseOptions: {\n    headers: { \"api-key\": apiKey },\n    params: { \"api-version\": \"2023-07-01-preview\" },\n  },\n});\n```\n\n## Advanced usage\n\nWith 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.\n\nProvide the `custom-headers` attribute as a string inside of the headers object:\n\n```javascript\n\nconfig = new Configuration({\n  basePath: `https://${APIM_ENDPOINT}/openai/deployments/${OPENAI_DEPLOYMENT_NAME}`,\n\n  baseOptions: {\n    headers: { \n      \"api-key\": apiKey,\n       \"custom-headers\": JSON.stringify({\n            user: \"a_unique_id\",\n            planId: \"your_plan_id\",\n            region: \"your_region\",\n            application: \"my-web-app\",\n            appVersion: \"1.0.0\"\n          }),\n    },\n    params: { \"api-version\": \"2023-07-01-preview\" },\n  },\n});\n```\n\nAs 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.\n\n\n\n## Debugging issues\n\n- Test your new endpoint by using the API Management tester (APIM -> APIs -> OpenAI Proxy API -> Test)\n  - For `deployment-id` use a model deployment name you have deployed in Azure Open AI (eg. \"gpt-35-turbo\")\n  - For `api-version` use the API version you are using (eg. \"2023-07-01-preview\")\n  - 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`\n\n## Architecture footprint\n\nThe main components of the architecture include:\n\n- API Management (Con","github_created_at":"2023-09-05T01:28:06+00:00","created_at":"2026-07-11T23:14:19.420339+00:00","updated_at":"2026-07-11T23:14:30.657485+00:00","categories":[{"slug":"llm-frameworks","name":"LLM Frameworks","url":"https://www.graphcanon.com/categories/llm-frameworks","markdown_url":"https://www.graphcanon.com/categories/llm-frameworks.md","api_url":"https://www.graphcanon.com/api/graphcanon/categories/llm-frameworks"},{"slug":"computer-vision","name":"Computer Vision","url":"https://www.graphcanon.com/categories/computer-vision","markdown_url":"https://www.graphcanon.com/categories/computer-vision.md","api_url":"https://www.graphcanon.com/api/graphcanon/categories/computer-vision"},{"slug":"inference-serving","name":"Inference & Serving","url":"https://www.graphcanon.com/categories/inference-serving","markdown_url":"https://www.graphcanon.com/categories/inference-serving.md","api_url":"https://www.graphcanon.com/api/graphcanon/categories/inference-serving"}],"tags":[{"slug":"bicep","name":"bicep"}],"trust":{"provenance":{"is_fork":false,"github_id":687254137,"owner_type":"User","methodology":"github_public_v1","parent_repo":null,"near_duplicate_slugs":[]},"computed_at":"2026-07-11T23:14:26.639Z","maintenance":{"label":"Dormant","score":18,"methodology":"github_public_v1","releases_90d":0,"days_since_push":370,"last_release_at":"2023-10-02T15:40:15Z"},"security_summary":{"status":"no_lockfile","scanner":null,"low_count":0,"high_count":0,"last_scan_at":"2026-07-11T23:14:27.210Z","medium_count":0,"scan_profile":"none","critical_count":0}},"capability_facts":{"scan":{"source":"repo_scan","observed_at":"2026-07-11T23:14:26.312Z"},"languages":{"value":["bicep"],"source":"github.language","observed_at":"2026-07-11T23:14:26.312Z"}}}}