Repository navigation
fix(metrics): Rename labels the collection pipeline reserves - #1193
Conversation
masque-authority serves the grant API and no metrics endpoint, so TestEveryBinaryHasScrapeTest fails on main since the command landed. List it with the other commands that serve no metrics. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The collection pipeline sets node, namespace and provider on every series it scrapes. Three custom collectors set those labels themselves, so their values collided with the pipeline's. The library's constructors refuse reserved names, but a collector builds its own descriptors and the library never checks them. - The Edge state gauges label their provider edge_provider, as the failure counters already name their role edge_role. - The fabric routing fleet series name the object's namespace resource_namespace and the node a deployment or router targets target_node. - The traffic policy rule and fallback counters name the interface's namespace resource_namespace. The fabric-router-controller PodMonitor no longer sets honorLabels, which only kept the object's namespace from being renamed exported_namespace. The fabric routing rules now also aggregate away node when they merge the two controller replicas, since the series now carry the controller pod's node from the pipeline. TestCustomCollectorLabels type-checks the module, resolves the label names of every prometheus.NewDesc, and fails on a reserved name or one it can't resolve. It fails on the three collectors without this change. The rule tests give each replica its own node and pass; run against the previous rules they fail for all 13 affected alerts. Fixes #1150 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
Renamed labels, for the release notes. Every value is unchanged.
Checks I ran:
|
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The conventions said a custom collector's label names need review by hand, and that the metrics still setting reserved labels were being renamed. TestCustomCollectorLabels now checks those names and no metric sets a reserved label, so the conventions name the test and drop the stale note. The list of instrumentation tests describes it. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
Warning Polylane could not verify the production impact of this pull request. I checked the live production cluster Also considered · 4 refuted
Analysed against 1 cloud account and 1 repository
Polylane could not find the cloud resources this repository manages, so this review looked at the entire cloud account. Connect this repository to its resources and the next review will focus on exactly what this code deploys to. Polylane analysed Rate this review: 👍 helpful · 👎 not helpful · 😕 confusing Previous verdicts (1)
|
ecv
left a comment
There was a problem hiding this comment.
Approve.
The renames are complete and consistent in the collectors, in-repo rules, rule tests and PodMonitor, and a new test guards against reserved labels. The one real risk sits in infra: its staging copy of these rules still uses the old labels, so it must be re-copied in the same bundle bump.
The red Unit Tests is not this PR: TestEveryBinaryHasScrapeTest fails on cmd/masque-authority, which main has carried without a scrape test since #1176, and main's CI fails the same way.
- infra
infrastructure/monitoring/galactic/staging/galactic-bgp-alerts.yamlis a copy of this file and is not touched here. Once staging picks up this bundle, itsfabric-routinggroup (all 13 alerts) still aggregateswithout (pod, instance, ...), so the controller pod's newnodelabel differs per replica: each alert doubles and a leader change splits the series and restartsfor. Its annotations also render the controller's node and an empty$labels.namespace. - The same copy's
galactic-edgealerts usemax by (provider, reason):provideris now empty, so providers merge into one alert per reason and the summary text loses the provider name. - Production is not affected: infra's production overlay removes both groups and the production edge pins
v0.8.0. The staging copy needs the identical rename andnodeaggregation, merged with the first staging bundle that carries this change. - Every rule whose expression changes in this PR (all 13 fabric-routing and both edge alerts that group on
provider) resets alert state in whatever evaluator loads it. This is staging-only today. - The PodMonitor edit removes only
honorLabels: trueand its comment. It removed no relabelings, sojob,pod,instanceandnodestill come from the pipeline, andtarget_nodekeeps the old per-deployment node value for joins with kube-state-metrics (label_replacetonode, oron (target_node)against a renamed side).
Follow-ups:
- infra dashboard
galactic-traffic-policy(.jsonnet/galactic-traffic-policy/config.jsonnet) groups onexported_namespaceforgalactic_cni_traffic_policy_rule_*andfallback_*. It becomes empty onceresource_namespacereplaces it; the dashboard needsresource_namespace. - Rename map for release notes:
galactic_edge_foundation_{attachments,routes,services}providertoedge_provider;galactic_fabric_routing_*(exceptcollect_success)namespacetoresource_namespace;galactic_fabric_routing_deployment_*androuter_acceptednodetotarget_node;galactic_cni_traffic_policy_{rule,fallback}_*namespacetoresource_namespace.
…pt' into fix/issue-1150
ecv
left a comment
There was a problem hiding this comment.
Approve.
The only change since 8a2a4ff adds masque-authority to noMetricsEndpoint, which fixes the TestEveryBinaryHasScrapeTest failure main has carried since #1176. The exemption is accurate: cmd/masque-authority serves only the grant API over TLS and registers no /metrics handler. My earlier findings on infra's staging alert copy and the galactic-traffic-policy dashboard stand.
Follow-ups:
- The grant authority exports no metrics, so issue, deny and authentication-failure rates are invisible. When it gets a metrics endpoint, drop it from the exemption list and add a scrape test.
Summary
Three metric collectors set labels that the collection pipeline owns, so their values collided with the pipeline's own values. This renames the provider, namespace and node labels on the Edge, fabric routing and traffic policy metrics, and keeps every value. Alerts, their tests, the scrape config and the operator docs use the new names. A new unit test fails the build if any collector sets a reserved label.
Compatibility
Queries, dashboards and alerts on the old names stop matching. The downstream copy of these alerts and the traffic policy dashboard need the same rename, merged together with this PR, because staging tracks
main. The release notes should list the renames, which are in the first comment.Rolling back restores the old names.
Test plan
main, naming exactly the three collectors, and passes here.main's rules for all 13 affected alerts, so each alert still fires after the rename.main, so either PR can merge first.Fixes #1150
🤖 Generated with Claude Code