-
Notifications
You must be signed in to change notification settings - Fork 853
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
Option to suppress controller and view spans #3865
Option to suppress controller and view spans #3865
Conversation
I explored using the new "instrumentation type" for this suppression, but I think the instrumentation type is nicely scoped to semantic conventions, and so this doesn't quite fit. And since there's not semantic conventions, or semantic convention attribute extractors for controllers and views, there's no way to auto-detect the instrumentation type in this case. An open question I have is that it might be nicer to have a "noop" Instrumenter that can be used, instead of having |
I went ahead and applied to all existing Instrumenters to get a fuller picture |
…ess-internal-spans
import io.opentelemetry.instrumentation.api.instrumenter.Instrumenter; | ||
|
||
public final class DropwizardSingletons { | ||
|
||
private static final String INSTRUMENTATION_NAME = "io.opentelemetry.dropwizard-views-0.7"; | ||
|
||
private static final boolean SUPPRESS_CONTROLLER_SPANS = | ||
Config.get() | ||
.getBoolean("otel.instrumentation.common.experimental.suppress-controller-spans", false); |
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.
We should somehow have this in the javaagent-api artifact rather than copying into every module I guess. Either a method on Config
or something like JavaAgentConfig
with all of them exposed rather than using the flags directly.
// lazy initialized, so that javaagent can set it, and library instrumentation can fall back and | ||
// read system properties | ||
@Nullable private static ExperimentalConfig instance = null; |
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.
That's not true for this class - I think we can safely use a static final
instance. It is Config
that needs to have lazy initialization, because it's "real" instance is being set by the agent.
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.
indeed, thx!
…ess-internal-spans
…ess-internal-spans
Introduces two new options:
otel.instrumentation.common.experimental.suppress-controller-spans
otel.instrumentation.common.experimental.suppress-view-spans
to suppress the controller and view spans.