Skip to content

chore(monitoring): scrape batch-pipeline workers into the in-cluster Prometheus - #24079

Merged
Git-on-my-level merged 1 commit into
mainfrom
lane/workerscrape
Oct 29, 2026
Merged

Git-on-my-level merged 1 commit into
mainfrom
lane/workerscrape

Conversation

@Git-on-my-level

@Git-on-my-level Git-on-my-level commented Oct 29, 2026 •

Copy link
Copy Markdown
Member

Why

The prometheus-adapter (prod-omi-prometheus-adapter) reads the in-cluster
Prometheus (prod-omi-kube-prometheus-stack), not GMP. The external rules
behind the batch worker HPA (#23891) — omi_batch_pipeline_admissible_ready_units
and omi_batch_pipeline_ready_age_seconds, already present in
prod_omi_prometheus_adapter.yaml — match zero series today because no scrape
job selects the batch-pipeline-worker pods into that Prometheus; they only
feed GMP. Until this lands, the worker HPA cannot scale batch to 100%: the
external metrics API returns no values.

What

Adds a batch-pipeline-worker-metrics job to additionalScrapeConfigs,
mirroring the diarizer-batch-metrics precedent from #21448 (the 2026-10-14
diarizer-batch cutover):

  • scrape_interval: 15s, role: pod, namespaces: [prod-omi-backend]
  • keeps on the app.kubernetes.io/name: batch-pipeline-worker label (selects
    every chart release, not one instance name), the http container port
    (8080 — the same port the chart's GMP PodMonitoring scrapes), and Running
    phase
  • relabels exactly namespace + pod: the adapter's freshness joins run
    on (namespace, worker_release, pod), so the scrape must attach those two;
    priority and worker_release ride the metric samples themselves and are
    left untouched (no metric_relabel_configs)

Declares the job in expected-targets.prod.yaml (mechanism
additionalScrapeConfigs, auth: null — the worker's /metrics handler is
unauthenticated, namespace prod-omi-backend, coverage_status: declared
with no coverage alert, same class as diarizer-batch-metrics) and pins the
whole shape in test_batch_pipeline_chart.py next to the worker's other
scrape contracts. The telemetry contract test enforces values↔inventory
bidirectionally, so both sides land together.

Series this enables (at today's 3 replicas)

family labels series
omi_batch_pipeline_admissible_ready_units priority, worker_release, namespace 9 (3 pods × 3 priorities)
omi_batch_pipeline_capacity_refreshed_at_seconds worker_release, namespace 3
omi_batch_pipeline_ready_age_seconds priority, worker_release, namespace 9
omi_batch_pipeline_metrics_refreshed_at_seconds worker_release, namespace 3

Risk

  • Cardinality: the four adapter-consumed families add 24 series at 3
    pods. The job scrapes the worker's full /metrics exposition (as the
    diarizer job does for its pods), bounded by the runtime's registry — an
    O(100) series addition against the 2.25M-series head, ingested locally by
    both Prometheus replicas, no Cloud Monitoring reads. Negligible.
  • No behavioral change until applied: this only edits repo values. The
    rollout lead applies the stack with the pinned-chart runbook (helm upgrade
    prod-omi-kube-prometheus-stack, chart 75.15.1, per the monitoring README)
    in the same window as the prometheus-adapter apply that carries the HPA
    rules. No .github/ changes, no flag flip, no IAM change, no data mutation.
  • Target growth is bounded: targets exist only while worker pods run
    (today 3; perf(batch): enable production worker autoscaling #23891's maxReplicas 16 bounds the ceiling).

Test plan

  • Local backend unit shard (BACKEND_UNIT_TEST_FILE_LIST) green: 86 passed
    across test_batch_pipeline_chart.py (new pin),
    test_monitoring_telemetry_contract.py (inventory bidirectional +
    declared-gap rules), test_diarizer_batch_prereqs.py (neighbor job
    unaffected).
  • CI backend unit shard covers the same three files.

Failure-Class: none

View guided diff Turn on auto-fix

…Prometheus

The prometheus-adapter reads the in-cluster Prometheus, not GMP, so the
omi_batch_pipeline_* external rules behind the worker HPA (#23891) matched
zero series: nothing scraped the batch-pipeline-worker pods into that
Prometheus. Add a batch-pipeline-worker-metrics additionalScrapeConfigs job
mirroring diarizer-batch-metrics (#21448): 15s, role pod, prod-omi-backend,
keep on the app.kubernetes.io/name label, the http port and Running phase,
relabel exactly namespace+pod so the adapter's per-pod freshness join
(namespace, worker_release, pod) resolves; priority and worker_release ride
the metric samples. Declare the job in expected-targets.prod.yaml as a
declared batch target with no coverage alert, and pin the whole contract in
test_batch_pipeline_chart.py alongside the worker's other scrape checks.
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 29, 2026 •

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-10-29T22:29:22.883943Z f118c68 PR opened
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@Git-on-my-level
Git-on-my-level merged commit aea157f into main Oct 29, 2026
62 checks passed
@Git-on-my-level
Git-on-my-level deleted the lane/workerscrape branch October 29, 2026 22:37
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