Skip to content

feat(BA-6225): expand and rename Prometheus query presets#11845

Open
seedspirit wants to merge 4 commits into
mainfrom
feat/BA-6225
Open

feat(BA-6225): expand and rename Prometheus query presets#11845
seedspirit wants to merge 4 commits into
mainfrom
feat/BA-6225

Conversation

@seedspirit
Copy link
Copy Markdown
Contributor

Summary

  • Rename the 8 example Prometheus query presets to verbose, aggregation-explicit names (e.g. container_gaugePer-Kernel Resource Metric — Instant Value (sum)) and add avg/max/min variants for container and vLLM metrics, growing the set from 8 to 22.
  • Add migration 7af18070fdef that renames/deletes the seeded container presets by name (the prior seed used uuid_generate_v4(), so ids differ per environment) and idempotently seeds all new container + vLLM presets and their categories.
  • Drop the container_rate (sum(rate)/5.0) preset whose normalization doesn't compose with avg/min/max.

Test plan

  • Migration idempotency: re-running on already-seeded DB is a no-op (counts + updated_at unchanged)
  • Production simulation: old seed rows with auto-generated UUIDs → rename in place, container_rate deleted, new rows inserted
  • Full chain re-applied after rebase onto new main heads (338bc3284f20, bee1c0de01a1) — single linear alembic head
  • pants lint/check (ruff/mypy/visibility) pass
  • CLI prometheus-query-definition execute against a live session — all 8 container presets return correct, aggregation-consistent values; verified dynamic CPU load tracking

Resolves BA-6225

@github-actions github-actions Bot added size:XL 500~ LoC comp:manager Related to Manager component require:db-migration Automatically set when alembic migrations are added or updated labels May 28, 2026
seedspirit added a commit that referenced this pull request May 28, 2026
@seedspirit seedspirit marked this pull request as ready for review May 29, 2026 06:17
@seedspirit seedspirit requested a review from a team as a code owner May 29, 2026 06:17
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR expands and renames the default/example Prometheus query presets to use verbose, aggregation-explicit names and adds additional aggregation variants for container and vLLM metrics, with a new Alembic data migration to update/seed the presets in existing databases.

Changes:

  • Add Alembic migration 7af18070fdef to rename/delete legacy seeded container presets (by name) and seed new container + vLLM presets and categories.
  • Expand the example fixture presets set (8 → 22) with renamed presets and avg/max/min variants.
  • Add a changelog entry describing the expanded/renamed preset set.

Reviewed changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 3 comments.

File Description
src/ai/backend/manager/models/alembic/versions/7af18070fdef_expand_prometheus_query_presets.py Data migration to seed categories and insert/rename/delete Prometheus query presets.
fixtures/manager/example-prometheus-query-presets.json Updates example presets to the new verbose names and adds new aggregation variants.
changes/11845.feature.md Changelog entry for the preset expansion/rename.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

jopemachine
jopemachine previously approved these changes May 29, 2026
@seedspirit seedspirit marked this pull request as draft May 29, 2026 06:38
seedspirit added a commit that referenced this pull request May 29, 2026
@seedspirit seedspirit force-pushed the feat/BA-6225 branch 2 times, most recently from 5c6bb7e to 9ea8624 Compare May 29, 2026 08:27
seedspirit and others added 3 commits June 2, 2026 15:10
Rename the 8 example presets to verbose, aggregation-explicit names and add
avg/max/min variants for container and vLLM metrics (8 -> 22). Add a migration
that renames/deletes the seeded container presets by name and seeds all new
container and vLLM presets idempotently, including their categories.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
The example fixture seeds 5 vLLM preset ids under legacy names, so the
name-guarded insert hit the primary key on fixture-seeded DBs (every dev/CI
environment). Upsert by id (the table's only unique key) so both production
and fixture-seeded DBs converge to the new definitions. Also inline
single-use constants for readability and repoint down_revision to the current
alembic head (0113c63f3261) after rebasing onto main.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
@seedspirit seedspirit marked this pull request as ready for review June 2, 2026 06:13
The preset migration still revised 0113c63f3261, which main has since
advanced past (c0ffee5a91d3 -> 1a2b3c4d5e6f), leaving two diverged heads.
Re-point down_revision to 1a2b3c4d5e6f to linearize the chain.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
@seedspirit seedspirit requested a review from jopemachine June 2, 2026 06:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

comp:manager Related to Manager component require:db-migration Automatically set when alembic migrations are added or updated size:XL 500~ LoC

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants