fix: treat missing/disabled endpoint as no-op tracing, not an error - #1088
fix: treat missing/disabled endpoint as no-op tracing, not an error#1088uzairhameed wants to merge 1 commit into
Conversation
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (1)
🚧 Files skipped from review as they are similar to previous changes (1)
📝 WalkthroughWalkthroughTracing now supports explicit enablement or disablement. Initialization returns no tracing provider when disabled or when no endpoint is configured. Tests cover these states, YAML configuration, and OpenTelemetry global state restoration. ChangesTracing activation
Estimated code review effort: 2 (Simple) | ~10 minutes Possibly related PRs
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@tracing/tracing_test.go`:
- Around line 36-74: Add a table-driven test case exercising
InitTracerFromYamlConfig with YAML containing an endpoint and enabled: false,
and assert it returns no error with a nil provider. Keep the existing direct
Config cases unchanged and ensure the test validates the Enabled YAML tag and
disabled-tracing behavior.
🪄 Autofix
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: defaults
Review profile: CHILL
Plan: Pro Plus
Run ID: e045fb81-68ed-4335-9bf0-52b1d6631801
📒 Files selected for processing (2)
tracing/tracing.gotracing/tracing_test.go
Signed-off-by: Uzair Hameed <uzairhameed98@gmail.com>
a20efb1 to
37c550e
Compare
Fixes: #894
Summary
Makes tracing opt-in rather than attempted-by-default:
Enabled *boolfield toConfig. When nil, tracing is enabledonly if
Endpointis set. When explicitlyfalse, tracing is alwaysdisabled regardless of
Endpoint.InitTracernow returnsnil, nil(a clean no-op, not an error) wheneither no endpoint is configured, or tracing is explicitly disabled.
Previously, an empty
Endpointcaused a hard error.Why
Meshery Server was logging repeated "connection refused" errors when no
trace collector was configured, because it kept attempting to reach a
default OTLP address. The original scenario (nothing configured at all)
has separately been mitigated in meshery's
main.go, but the sameprotection was missing at the meshkit layer, leaving any other meshkit
consumer exposed to the same issue.
Scope
This PR is intentionally narrow, per review feedback, and covers only
the opt-in/endpoint-check behavior.
Testing
Unit tests cover: missing service name (unchanged behavior), missing
endpoint (no-op, not an error), explicit disable with an endpoint set,
explicit enable with no endpoint (still a no-op), and explicit enable
with a valid endpoint (returns a real provider). All existing tests
continue to pass.
Related
OTEL_CONFIGinvalues.yaml):feat: expose OTEL_CONFIG in Helm chart values.yaml, disabled by default meshery#20898
split per maintainer feedback): [meshkit] fix: disable tracing when no endpoint configured, suppress repeated export-failure logs #1070
Signed commits
Summary by CodeRabbit
New Features
Bug Fixes