Skip to content

feat(monitoring): Add Vertex AI API usage aggregation#86

Draft
sinmetal wants to merge 1 commit into
mainfrom
vertex-ai-monitoring-aggregation
Draft

feat(monitoring): Add Vertex AI API usage aggregation#86
sinmetal wants to merge 1 commit into
mainfrom
vertex-ai-monitoring-aggregation

Conversation

@sinmetal
Copy link
Copy Markdown
Member

@sinmetal sinmetal commented Jun 5, 2025

This commit introduces functionality to aggregate Vertex AI API usage metrics from Cloud Monitoring on a per-day basis.

Key changes:

  • Created a new monitoring/ai package.
  • Defined data structures (RawMetric, AggregatedDailyCount) for handling Vertex AI metrics in monitoring/ai/metrics.go.
  • Implemented FetchVertexAIMetrics to retrieve metrics (currently using mock data for GCP API calls) and AggregateMetricsByDay to process these metrics into daily summaries in monitoring/ai/aggregator.go.
  • Added comprehensive unit tests in monitoring/ai/aggregator_test.go to validate the aggregation logic across various scenarios, including empty datasets, single-day and multi-day metrics, and different metric properties.

The new functionality provides a way to track daily Vertex AI API executions, which can be useful for cost monitoring and usage analysis.

This commit introduces functionality to aggregate Vertex AI API usage
metrics from Cloud Monitoring on a per-day basis.

Key changes:
- Created a new `monitoring/ai` package.
- Defined data structures (`RawMetric`, `AggregatedDailyCount`) for
  handling Vertex AI metrics in `monitoring/ai/metrics.go`.
- Implemented `FetchVertexAIMetrics` to retrieve metrics (currently
  using mock data for GCP API calls) and `AggregateMetricsByDay`
  to process these metrics into daily summaries in
  `monitoring/ai/aggregator.go`.
- Added comprehensive unit tests in `monitoring/ai/aggregator_test.go`
  to validate the aggregation logic across various scenarios,
  including empty datasets, single-day and multi-day metrics, and
  different metric properties.

The new functionality provides a way to track daily Vertex AI API
executions, which can be useful for cost monitoring and usage analysis.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant