feat(byoo-otel-collector): add SRE metrics pipeline#266
Conversation
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Enterprise Run ID: ⛔ Files ignored due to path filters (1)
📒 Files selected for processing (14)
💤 Files with no reviewable changes (3)
🚧 Files skipped from review as they are similar to previous changes (9)
📝 WalkthroughWalkthroughThe collector adds opt-in SRE metrics configuration, registers a Prometheus exporter, exposes port 19091, and renders a separate filtered ChangesSRE metrics pipeline
Estimated code review effort: 4 (Complex) | ~45 minutes Sequence Diagram(s)sequenceDiagram
participant OTLPReceiver
participant CustomerMetricsPipeline
participant SREMetricsPipeline
participant PrometheusExporter
OTLPReceiver->>CustomerMetricsPipeline: Receive customer OTLP metrics
OTLPReceiver->>SREMetricsPipeline: Reuse OTLP metrics receiver
CustomerMetricsPipeline->>CustomerMetricsPipeline: Drop configured SRE control labels
SREMetricsPipeline->>SREMetricsPipeline: Apply filter and dedicated batch processors
SREMetricsPipeline->>PrometheusExporter: Export filtered SRE metrics
🚥 Pre-merge checks | ✅ 3 | ❌ 2❌ Failed checks (2 warnings)
✅ Passed checks (3 passed)
✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Warning There were issues while running some tools. Please review the errors and either fix the tool's configuration or disable the tool if it's a critical failure. 🔧 golangci-lint (2.12.2)level=error msg="[linters_context] typechecking error: pattern ./...: directory prefix . does not contain main module or its selected dependencies" Comment |
🛡️ CodeQL Analysis🚨 Found 2 issue(s) Severity Breakdown:
📋 Top Issues🔗 View full details in Security tab 🕐 Last updated: 2026-07-20 16:49:46 UTC | Commit: dd541bf |
dd541bf to
4349726
Compare
Refs #265 Signed-off-by: Kristina Pathak <kristina.m.pathak@gmail.com>
4349726 to
14b22f8
Compare
TL;DR
Add an opt-in BYOO SRE metrics pipeline that fans out OTLP metrics from the customer metrics receiver to a filtered Prometheus scrape endpoint on port
19091.Additional Details (optional for docs, build, test, refactor, ci, chore, style, and revert PRs)
BYOO_SRE_METRICS_ENABLED, disabled by default.BYOO_SRE_METRICS_FILTER_CONFIG, a runtime YAML filter processor config for the SRE metrics pipeline. The default keeps onlyBpsInstrument,FpsInstrument,RtdInstrument, andStageOpenDuration, unless telemetry is explicitly labeled with an SRE metrics opt-out value.BYOO_CUSTOMER_METRICS_DROP_LABELS, a comma-separated resource attribute drop list applied only to the customer metrics pipeline when the SRE pipeline is enabled.19091/tcpfrom the image.examples/otelconfigs/k8s/config_function_container_sre_metrics.yaml.For the Reviewer
Please look closely at
src/compute-plane-services/byoo-otel-collector/internal/otelconfig/render.go, especially the default filter config, pipeline ordering, and customer drop-label processor placement.For QA (optional for docs, build, test, refactor, ci, chore, style, and revert PRs)
GOCACHE=/private/tmp/nvcf-byoo-sre-metrics-go-cache go test ./internal/otelconfigGOCACHE=/private/tmp/nvcf-byoo-sre-metrics-go-cache GOMODCACHE=/private/tmp/nvcf-byoo-sre-metrics-go-mod ./scripts/regenerate-otelcol.shGOCACHE=/private/tmp/nvcf-byoo-sre-metrics-go-cache GOMODCACHE=/private/tmp/nvcf-byoo-sre-metrics-go-mod ./tools/ci/check-otelcol-generatedGOCACHE=/private/tmp/nvcf-byoo-sre-metrics-go-cache GOMODCACHE=/private/tmp/nvcf-byoo-sre-metrics-go-mod go test ./...GOCACHE=/private/tmp/nvcf-byoo-sre-metrics-go-cache GOMODCACHE=/private/tmp/nvcf-byoo-sre-metrics-go-mod go test ./otelcol/...GOCACHE=/private/tmp/nvcf-byoo-sre-metrics-go-cache GOMODCACHE=/private/tmp/nvcf-byoo-sre-metrics-go-mod go test ./internal/otelconfig -run TestRenderOtelConfigWithSREMetricsPipelineMatchesExample -count=1examples/otelconfigs/k8s/config_function_container_sre_metrics.yamlwith./_output/bin/otelcol-contrib validate --config=...using local placeholder token/cert/key path substitutions.testdata/*.json,vm|k8s,container|helm, andtask|functionusing./_output/bin/otelcol-contrib validate --config=...with local example secret and token path substitutions.make validate-otelconfigwas also attempted. Its config validation phase reached the generated config, but the local macOS runtime startup check fails because the cgroup runtime extension cannot setGOMEMLIMITon this system.Issues
Closes #265
Checklist
Summary by CodeRabbit
/metricsendpoint on port 19091 and adds a dedicated metrics/sre pipeline.