Repository navigation
fix(k8s): the prometheus server scrapes only itself and the otel collector, and k8s-monitoring discovers every other target - #1527
Merged
dan-petty merged 1 commit intoOct 9, 2026
Conversation
…ector, and k8s-monitoring discovers every other target (#1130) The Prometheus server keeps two scrape jobs: its self-scrape and kubernetes-pods, which now keeps only namespace otel, so the collector's export failures stay visible when Alloy is what fails. Both take the cluster relabel from one YAML anchor, so the self-scrape carries cluster. The six other chart-default jobs are off, among them the API-server scrape that held about 60% of head series and nothing read. k8s-monitoring takes over every other target with chart features: annotation autodiscovery (prometheus.io/* keys, otel excluded, no Service discovery, no ServiceAccount token), clusterMetrics.kubeDNS, and the Loki and dcgm-exporter integrations. Autodiscovery, kube-dns and DCGM copy the pod's node to node. Loki loses its scrape annotations, the DCGM chart's ServiceMonitor is off, and Alertmanager names its container so the config-reloader sidecar's target does not scrape it twice. The monitoring perimeter already has exactly one egress rule per scrape port. k8s/README.md gains a Scrape Ownership table of the monitoring components that run outside k8s-monitoring, and why.
dan-petty
enabled auto-merge (squash)
October 9, 2026 21:11
dan-petty
deleted the
fix/1130-prometheus-scrapes-itself-and-the-collector
branch
October 9, 2026 21:12
This was referenced Oct 9, 2026
Merged
dan-petty
added a commit
that referenced
this pull request
Oct 10, 2026
* docs(agents): feasibility check, stop signals, and devops roadmap return (#1348) (#1518) * chore(roadmap): release_cap 16 until the Service runs #1514's 4 release slots (#1520) The running Service trims a starting release, and descopes a started one, above release_cap (12). v0.2.34 holds 16 items. Setting release_cap to 16 keeps them in place until the Service runs #1514 (fill to 12, 4 slots to 16); the line is removed then. * test(cli): swallowed failures may not grow (#1347) (#1521) * feat(review): publish scanner findings to code scanning (#419) (#1524) * fix(roadmap): refine writes its section's end marker, so a re-refined item keeps one design section instead of two (#1470) (#1525) * feat(roadmap): a release keeps 4 slots above its cap of 12, so a start still fills to 12 and nothing is trimmed or descoped until it holds more than 16 (#1514) (#1528) * fix(k8s): the prometheus server scrapes only itself and the otel collector, and k8s-monitoring discovers every other target (#1130) (#1527) The Prometheus server keeps two scrape jobs: its self-scrape and kubernetes-pods, which now keeps only namespace otel, so the collector's export failures stay visible when Alloy is what fails. Both take the cluster relabel from one YAML anchor, so the self-scrape carries cluster. The six other chart-default jobs are off, among them the API-server scrape that held about 60% of head series and nothing read. k8s-monitoring takes over every other target with chart features: annotation autodiscovery (prometheus.io/* keys, otel excluded, no Service discovery, no ServiceAccount token), clusterMetrics.kubeDNS, and the Loki and dcgm-exporter integrations. Autodiscovery, kube-dns and DCGM copy the pod's node to node. Loki loses its scrape annotations, the DCGM chart's ServiceMonitor is off, and Alertmanager names its container so the config-reloader sidecar's target does not scrape it twice. The monitoring perimeter already has exactly one egress rule per scrape port. k8s/README.md gains a Scrape Ownership table of the monitoring components that run outside k8s-monitoring, and why. * feat(review): ruff and mypy review evidence with project settings (#873) (#1523) * fix(release): the Service's cut commit collects the changelog fragments into the version's CHANGELOG.md section (#1450) (#1522) * feat(cli): reachable --dry-run previews for delegated commands (#412) (#1530) * feat(roadmap): refine runs every hour and readies the new items of every planned release, nearest first, before that release starts (#1515) (#1531) * refactor(review): the model verifier, the hallucination catalog and the model-claim guards are deleted, and person-recorded verdicts become suppressions (#1150) (#1529) * fix(roadmap): the service runs close and reprioritize in their own lane, so a slow model-bound intake or refine round never holds up a release (#1532) (#1536) * feat(release): v0.2.33 * fix(security): bandit covers src and tests at medium severity through one config the gate and the code-scanning upload share, and the test findings are fixed (#1542) (#1546) * fix(server): devops serve --service leaves the process's logging alone until uvicorn applies its json config, so in-process tests keep their captured logs (#1543) (#1545) * chore(release): collect the v0.2.33 changelog and fix the service-mode test the last two merges broke (#1547) * fix(server): the service-mode test expects the ::1 host it passes, so it no longer asserts 0.0.0.0 #1546 moved the test to --host ::1 to clear Bandit B104; #1545, written before it, set the expected host back to 0.0.0.0. The merge kept both, so the test failed and its 0.0.0.0 literal was Bandit's one medium finding. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01VyrhySxPaWHd2jsLCrfeXm * chore(release): collect the v0.2.33 changelog fragments into CHANGELOG.md The Service's cut of v0.2.33 (5c5df79) bumped the version without collecting changelog.d/, so release/v0.2.33 merging into main would fail `devops release check` in Release Orchestration, as v0.2.30 did (#1474). `devops release changelog --update -v 0.2.33` moves the 14 fragments into the [0.2.33] section and deletes them. 873.md had no category heading, which the collector refuses, and 412.md, 1347.md and 1348.md were not in house style; each is rewritten from its delivering commit before collection. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01VyrhySxPaWHd2jsLCrfeXm --------- Co-authored-by: Claude <noreply@anthropic.com> * chore(security): ignore CVE-2026-78669 in gh v2.102.0 until 2026-10-23, beside its Go 1.27.1 entries under #1492 (#1548) Trivy now fails the Service image on CVE-2026-78669, an HTTP/2 denial of service in net/http and golang.org/x/net, in the gh v2.102.0 binary (Go 1.27.1, x/net v0.58.0). No gh release carries the fix yet; cli/cli's trunk builds with Go 1.27.2 and x/net v0.60.0. gh is a client, and #1492's gh bump drops all three entries. Claude-Session: https://claude.ai/code/session_01VyrhySxPaWHd2jsLCrfeXm Co-authored-by: Claude <noreply@anthropic.com> --------- Co-authored-by: Daniel Petty <contact@danielpetty.com> Co-authored-by: dan-petty-bot <dan-petty-bot@users.noreply.github.com> Co-authored-by: Claude <noreply@anthropic.com>
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.
Summary
prometheusandkubernetes-pods, which now keeps only namespaceotel, so the collector's export failures stay visible when Alloy is what fails. Both take the cluster relabel from one&clusteranchor, so the self-scrape now carriescluster. The six other chart-default jobs are off, among them the unread API-server scrape (about 60% of head series, 59.7k of 99.6k on 2026-10-09).annotationAutodiscovery:prometheus.io/*keys,otelexcluded, Service discovery off, no ServiceAccount token;clusterMetrics.kubeDNS;node, so the node silence and the NodeNotReady inhibition keep covering their TargetDown.SkipDryRunOnMissingResource, which nothing needs any more. Alertmanager names its container, so the config-reloader sidecar's target does not scrape it twice.k8s/README.mdgains a Scrape Ownership table of the 8 components that run outside k8s-monitoring, with the owner and the reason. The stale scrape,node, Loki-retention and alloy-metrics-0 text is rewritten, along with the comments in prometheus-operator-crds,stack_lifecycle.pyand the prometheus-server dashboard.docs/agent/tasks/task-1130-prometheus-scrapes-itself-and-the-collector.mdandchangelog.d/1130.md. Earlier task files Alerts fire into nothing: no Alertmanager, and k3s false positives #549, feat(k8s): llm gateway, otel collector and prometheus dashboards over metrics the cluster collects (k8s/monitoring/dashboards/) #693, fix(k8s): deploy-stack installs the Prometheus Operator CRDs its ServiceMonitors need #819, Comprehensive k8s-monitoring telemetry integration and dashboard metric fixes #825, nvidia-dcgm-exporter-dashboard shows IP addresses rather than node names #935 and feat(k8s): argo cd image updater keeps the devops application on the digest of service:latest #1485 note what changed.Deviations from the issue text, each explained in the task file:
logging/single-binary;logs.enabledis false;Overlap with #412: the comment at
stack_lifecycle.py:80-81and one tuple intests/test_k8s.py.Closes #1130
Test plan
uv run pytest -n 0 tests/test_k8s_monitoring_integration.py tests/test_stack_dashboards.py tests/test_k8s_monitoring_alerting.py tests/test_k8s.py tests/test_llm_pool_metrics.py tests/test_agent_task_files.py tests/test_release_changelog_fragments.py --durations=0: all pass; each new test's call phase is at most 0.02 s.uv run pytest -n 0 tests/test_docs.py tests/test_k8s_argocd_apps.py tests/test_k8s_network_policies.py tests/test_resource_schemas.pyuv run ruff check,uv run ruff format --checkon the changed Python files;uv run mypy src/devops_cli/commands/k8s/stack_lifecycle.pyhelm templateof the cached k8s-monitoring 4.5.2 and prometheus 29.35.0 charts:bearer_token_file.kube_dnsand DCGM. DCGM'sscrape_intervalis 15s, and no Loki log rule renders.prometheus.ymlholds onlykubernetes-pods(theotelkeep first) andprometheus, both withcluster.devops ci(pre-push gate)count by (job) (up)job set, Alertmanager scraped once, theup{node=""}job list, the DCGM GPU count, the Loki and CoreDNS series, no series withoutcluster, no TargetDown, and about 60k fewer head series after three hours.