Repository navigation
fix(metrics): name the relevance counter so the Cloud Run sidecar keeps it - #17280
Merged
Merged
Conversation
…ps it The Cloud Run managed-Prometheus sidecar keeps only omi_.* metric names, so conversation_relevance_decision_total was exported but dropped at ingestion after the #16587 deploy. Renamed to omi_conversation_relevance_decision_total and pinned by a test that reads the sidecar keep rule from the deploy YAML. Co-Authored-By: Claude Opus 5.5 <[email protected]>
CodeQL flags the test's regex (py/redos, high): (?:\\s*#[^\\n]*)*\\s* has nested quantifiers and \\s matches newlines, so adversarial input can backtrack exponentially. Replace the comment-skipping regex with a linear line filter — same behavior, no backtracking class. Addresses CodeQL alert #359 on the new test file.
Git-on-my-level
force-pushed
the
fix/relevance-metric-prefix
branch
from
September 23, 2026 08:51
817faba to
f8fa134
Compare
Member
Author
|
Pushed The test's name-extraction regex Verification: |
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.
Why
The relevance counter shipped in #16587 (
conversation_relevance_decision_total) never reaches Prometheus: the Cloud Run managed-Prometheus sidecar (backend/deploy/cloud_run_gmp_sidecar.yaml) keeps onlyomi_.*names, so the metric is exported on/metricsand dropped at ingestion. Found during the post-deploy watch ofa8975fa68a:omi_product_event_totalis present in Prometheus from the same process, while the relevance counter has no series.What
omi_conversation_relevance_decision_total.test_relevance_metric_is_scraped.pyreads the sidecar keep regex from the deploy YAML and asserts the counter name matches it.lazy_desktop_deferral_totalandjit_first_open_totalin the same module are dropped the same way; not changed here (their dashboards/alerts are someone else's to rename).Failure-Class: new
Failure-class transition narrative
Adds
FC-metric-dropped-by-scrape-allowlist. Violated contract: a metric a feature relies on for visibility must survive the collector's keep rule; a non-omi_Cloud Run metric passes every test and is dropped at ingestion, so "no data" looks like "nothing happened". Canonical guard:omi_prefix plus a unit test that reads the sidecar keep regex from the deploy YAML. Evidence:conversation_relevance_decision_totalabsent from Prometheus after the 2026-09-23 prod deploy whileomi_product_event_totalfrom the same process is present.Verification
🤖 Generated with Claude Code