Repository navigation
Conversation
Signed-off-by: Danny <[email protected]>
Contributor
|
✅ OpenCodeReview: Review complete: 0 finding(s) across 3 selected item(s). |
This branch has not been deployed
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.
Description
With
OTEL_METRICS_EXPORTER=none, ocr no longer creates a metric exporter (OTLP gRPC, OTLP HTTP, console), so spans can go to a trace-only backend without a 404 on/v1/metricsat the end of every run. Any other value keeps the current behaviour.Initnow sets the global meter provider only when one was created. Without that guard a nil*sdkmetric.MeterProviderbecomes the global provider and the firstRecord*call panics;TestInit_MetricsExporterNoneRecordsNothinghits that panic when the guard is removed.The new
Config.NoMetricsfield is a negative so that existingConfig{}literals keep exporting metrics.Type of Change
How Has This Been Tested?
make check, andgo test -race ./internal/telemetrywith three new tests: env resolution, the three init paths with metrics off, andInitfollowed byRecord*calls. I did not run the fullmake testlocally.make testpasses locallyChecklist
go fmt,go vet)I used Claude Code (Claude Opus 5.5) to trace the cause and draft the change and this description.
Related Issues
Closes #2120