-
Notifications
You must be signed in to change notification settings - Fork 1.8k
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
[Enhancement] Support OTLP spans from FE #50903
[Enhancement] Support OTLP spans from FE #50903
Conversation
23d2eb6
to
1fdb58d
Compare
OpenTelemetry openTelemetry = builder.buildAndRegisterGlobal(); | ||
instance = openTelemetry.getTracer(SERVICE_NAME); | ||
} else { | ||
instance = GlobalOpenTelemetry.get().getTracer(SERVICE_NAME); |
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.
I didn't find any usages of the global OpenTelemetry instance and I don't expect any use cases within FE components where a Tracer instance is required which cannot be obtained through the TraceManager::getTracer interface. For this reason, the new code constructs a shared Tracer instance and adds span exporters as requested by the config.
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.
[Enhancement] Use noop tracer if endpoint not configured (#7724) Use noop tracer if jaeger endpoint not configured
If nothing is configed(the most common case), this will be used. If I remember correct, this is more efficient. Not an expert here, but Id like to not change things causing uneccessary instability. unless you are absolutely certern.
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.
Gotcha. Thank you @decster
I've pushed an update to this PR to explicitly use the NoOp tracer when tracing endpoints are not configured.
import org.junit.Before; | ||
import org.junit.Test; | ||
|
||
public class TraceManagerTest { |
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.
I tried setting up WireMock to spin up a mock server with which we could verify if the OpenTelemetry instance is configured correctly to hit tracing endpoints, but I didn't get far with this when I ran into issues with Jetty library resolution. Such an approach would also involve adding dependencies on Jaeger and OpenTelemetry proto files to set up a mock gRPC server, which may be overkill.
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.
understand this code is hard to cover indeed, skip it for now.
Signed-off-by: Jonathan Du <[email protected]>
ee241fe
to
3b45d44
Compare
Signed-off-by: Jonathan Du <[email protected]>
Signed-off-by: Jonathan Du <[email protected]>
Signed-off-by: Jonathan Du <[email protected]>
Quality Gate passedIssues Measures |
[Java-Extensions Incremental Coverage Report]✅ pass : 0 / 0 (0%) |
[FE Incremental Coverage Report]✅ pass : 35 / 35 (100.00%) file detail
|
[BE Incremental Coverage Report]✅ pass : 0 / 0 (0%) |
Signed-off-by: Jonathan Du <[email protected]> Signed-off-by: zhiminr.ren <[email protected]>
Why I'm doing:
What I'm doing:
Addresses #50835
What type of PR is this:
Does this PR entail a change in behavior?
If yes, please specify the type of change:
Checklist:
Bugfix cherry-pick branch check: