Skip to content

fix(go): add automatic telemetry metrics for background models#3841

Merged
apascal07 merged 1 commit intomainfrom
sahdev/feat/token-calculation-background-model
Dec 4, 2025
Merged

fix(go): add automatic telemetry metrics for background models#3841
apascal07 merged 1 commit intomainfrom
sahdev/feat/token-calculation-background-model

Conversation

@sahdev77
Copy link
Contributor

Add support for calculating and tracking usage metrics (input/output characters, images, videos, audio) and latency for background model operations. Metrics are now properly calculated when long-running operations complete, not when they start.

Help the reviewer by:

  • Modified background_model.go to remove addAutomaticTelemetry() middleware from the Start operation, since metrics should only be calculated when operations complete
  • Added CalculateInputOutputUsage() to reuse in background model plugin.
  • Updated VEO model implementation to store input request and start time in operation metadata during Start
  • Added telemetry calculation in VEO check function that computes both input/output usage metrics and latency when operation completes
  • Metadata restoration ensures input metrics and start time are preserved across operation status checks

Checklist (if applicable):

…characters, images, videos, audio) and latency for background model operations
@github-actions github-actions bot added feature New feature or request go labels Nov 23, 2025
@sahdev77 sahdev77 marked this pull request as draft November 23, 2025 11:37
@sahdev77 sahdev77 marked this pull request as ready for review November 26, 2025 04:45
@sahdev77 sahdev77 requested a review from apascal07 November 26, 2025 04:46
@apascal07 apascal07 changed the title feat(go): Add automatic telemetry metrics for background models fix(go): add automatic telemetry metrics for background models Dec 4, 2025
@apascal07 apascal07 merged commit 5880681 into main Dec 4, 2025
6 checks passed
@apascal07 apascal07 deleted the sahdev/feat/token-calculation-background-model branch December 4, 2025 14:07
@yesudeep yesudeep mentioned this pull request Feb 6, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

feature New feature or request go

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

2 participants