feat: token usage tracking implementation#257
Open
Priyanka-Microsoft wants to merge 5 commits into
Open
Conversation
…ersion and remove deployment/workbook changes - Updated llm_token_telemetry.py (processor + backend-api) to match Ajit's latest from customer-chatbot PR #236 (adds perf counters, emit timing, slow-emit warnings, batch overhead tracking) - Removed workbook/dashboard files (deploy-workbooks.ps1, KQL queries, workbook JSON files, tokenUsageWorkbook.bicep) - Reverted infra changes (main.bicep, main_custom.bicep, main.parameters.json) - Reverted Dockerfile changes (frontend, processor) - Removed test file (test_llm_token_telemetry.py) Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
The lockfile was missing the azure-monitor-events-extension and azure-monitor-opentelemetry packages, causing uv sync --frozen in Docker to skip them. This made the emitter silently disabled. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Purpose
This pull request introduces a complete solution for visualizing and monitoring LLM token usage in Azure Application Insights. It adds deployment automation, KQL queries for analytics, and a comprehensive Azure Workbook dashboard for both GKE and EKS environments.
LLM Token Usage Dashboard Solution:
Deployment Automation:
deploy-workbooks.ps1PowerShell script to automate deployment of LLM token usage dashboards for both GKE and EKS clusters. The script uploads the corresponding workbook JSON content to Azure using the provided resource group and Application Insights resource ID.Analytics and Visualization:
token-usage-queries.kql, a library of KQL queries for Application Insights/Log Analytics, enabling detailed analysis of token usage by agent, model, workflow step, user, and time trends, as well as cost estimation.workbook-eks-content.json, a ready-to-deploy Azure Workbook dashboard for EKS, featuring summary tiles, tables, charts, and cost estimation, all parameterized by time range.Does this introduce a breaking change?
Golden Path Validation
Deployment Validation
What to Check
Verify that the following are valid
Other Information