fix(otelconf): report Prometheus HTTP server errors in v0.2.0 #9653
All Vouch review confidence checks passed
Residual risk 0.15 = Change Risk (0.39) × (1 − Review Confidence (0.60)).
Review depth and reviewer attention state are adequate.
Model 1 · Change Risk (XGBoost)
Score: 0.39 · 241 lines diff across 3 files
Model 2 · Review Depth (DistilBERT)
Depth Score: 0.17 · 1 substantive comment(s)
Model 3 · Review Timing & Attention
Session adequacy: 100% · Reviewer familiarity: 35%
Bedrock Claude 3 · Risk Narration
(disconnected)
Groq Risk Narration
AWS Bedrock is currently disconnected. Generate high-confidence PR triage narration on-demand using Groq.
Model 1 · Change Risk Attribution
SHAP Weights
Diff Size
diff_size
0.328
Shallow Review Depth
shallow_review_depth
0.289
Real PR Conversation Timeline
1 comments
"Review active on #9653"
general
weight: 0.35
KR-Ravindra
Problem
go.opentelemetry.io/contrib/otelconf/v0.2.0starts an HTTP server for the Prometheus pull exporter in a goroutine. The error check onserver.Serve(lis)is inverted: a clean shutdown (http.ErrServerClosed) is reported throughotel.Handleas "the Prometheus HTTP server exited unexpectedly", while every genuineServefailure (accept errors, TLS/listener problems, etc.) is silently dropped. Operators therefore get a spurious error on every shutdown and no signal at all when the metrics endpoint actually stops serving.Root cause
otelconf/v0.2.0/metric.go:369:The condition is missing the negation. The sibling implementations in
otelconf/v0.3.0/metric.goandotelconf/x/metric.goalready use!errors.Is(err, http.ErrServerClosed).Fix
err != nil && !errors.Is(err, http.ErrServerClosed)), so the goroutine inprometheusReaderis now identical to the one inv0.3.0andx.CHANGELOG.mdentry under Unreleased / Fixed.No public API changes.
The first revision extracted the check into a
handleServeErrhelper with a table test; it was inlined again in e769464 at review request so the three implementations stay the same.How tested
The handler is the process-global
otel.Handle, so this branch has no isolated unit test (see the discussion on #9097); the fix is the same code thatv0.3.0andxalready run.From
otelconf/:go build ./...,go vet ./v0.2.0/...,go test -race ./v0.2.0/...(ok),golangci-lint run ./v0.2.0/...(0 issues).Links
This change was prepared with an AI agent operated by KR-Ravindra, who reviewed and tested it.