-
-
Notifications
You must be signed in to change notification settings - Fork 146
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix(otel): Don't require entrypoint config to initialize OTel #2579
fix(otel): Don't require entrypoint config to initialize OTel #2579
Conversation
✅ Deploy Preview for go-feature-flag-doc-preview canceled.
|
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #2579 +/- ##
==========================================
- Coverage 85.11% 85.09% -0.02%
==========================================
Files 101 101
Lines 4582 4583 +1
==========================================
Hits 3900 3900
Misses 544 544
- Partials 138 139 +1 ☔ View full report in Codecov by Sentry. |
39520e0
to
1ac2243
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@hairyhenderson I have tested this new version and my main concern is that we are still trying to call the OTLP when nothing is configured.
We have this log for every query:
{"level":"debug","ts":1730195483.37956,"caller":"opentelemetry/otel.go:93","msg":"OTel error","error":"traces export: Post \"https://localhost:4318/v1/traces\": dial tcp [::1]:4318: connect: connection refused"}
Maybe we should set the noop.NewTracerProvider()
when we have no OTLP endpoint configured.
yeah, that's why I set it to log at debug level...
Yeah, the issue is that if there's no exporter, defaults will be used (OTLP over http/protobuf on https://localhost:4318). I had thought that perhaps some users would want this. Realistically though, I think I'm the only user of GOFF that needs the OTel support so far, so requiring the endpoint to be set is probably fine. I'll update this to check |
1ac2243
to
4aad1e6
Compare
Signed-off-by: Dave Henderson <[email protected]>
4aad1e6
to
e6db682
Compare
@thomaspoignant I've simplified things - PTAL 🙂 |
a2ba621
to
a786d0a
Compare
Quality Gate passedIssues Measures |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks really good now 👍
Description
Changes behaviour to always call
otelService.Init
, to avoid requiring setting theopenTelemetryOtlpEndpoint
config element.If the OTel SDK is not explicitly disabled and no OTel endpoint is listening, the OTel SDK will complain in the logs. Since I don't want to unnecessarily spam logs, I'm adding support for the
OTEL_LOG_LEVEL
variable, but defaulting todebug
rather than the spec'sinfo
for somewhat more sane logs.Notes: I've not done it here, but I think deprecating
openTelemetryOtlpEndpoint
in the future is probably a good idea, in preference forotel.exporter.otlp.endpoint
. I've also noticed that theotel
config section is undocumented - I may have a look at that in a separate PR.Closes issue(s)
Fixes #2578
Checklist
README.md
and/website/docs
)