feat: Add LLM token usage tracking to Application Insights#586
Open
Prachig-Microsoft wants to merge 27 commits into
Open
feat: Add LLM token usage tracking to Application Insights#586Prachig-Microsoft wants to merge 27 commits into
Prachig-Microsoft wants to merge 27 commits into
Conversation
- Pass file metadata in TokenUsageScope for MapHandler, Summarize, GapAnalysis, and RAI executors so the workbook file-type query works - Fix dedup in model cost KQL query (workbook + queries file) Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Add SHA-256 based event_id (event_name|process_id|agent_name|model) to each emitted event, enabling KQL dedup without accelerator-specific max() patterns. This makes the workbook generic across accelerators. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
- Change emit_all() logging from INFO to DEBUG to reduce production log volume - Optional token-detail fields default to None when absent instead of 0 - Remove redundant extract_usage_from_stream_chunk() fallback in TokenUsageScope.add() - Pin azure-monitor-events-extension to ==0.1.0 in both projects - Revert enableMonitoring to false in default parameters Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
321eca7 to
f4ee50e
Compare
…ntProcessor) Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
…acking # Conflicts: # infra/main.json
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
The devcontainers/python image on MCR is returning 403 Forbidden. Use the official Python slim image instead, which is lighter and appropriate for production containers. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
…c file_types - Pass agent_name and model_deployment_name to emit_summary for unique event_id - Sort file_types set before joining for deterministic telemetry dimensions 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.
Implement comprehensive token usage tracking across all LLM call sites in ContentProcessor and ContentProcessorWorkflow, following the MACAE psl-token-usage branch pattern.
Changes:
Events emitted to Application Insights:
Does this introduce a breaking change?
Golden Path Validation
Deployment Validation
What to Check
Verify that the following are valid
Other Information