You can disable the agent using -Dotel.javaagent.enabled=false
(or using the equivalent environment variable OTEL_JAVAAGENT_ENABLED=false
).
You can suppress agent instrumentation of specific libraries by using
-Dotel.instrumentation.[id].enabled=false
.
where id
is the instrumentation id
:
[TODO add table here with all instrumentation ids]
You can also exclude specific classes from being instrumented.
This can be useful to completely silence spans from a given class/package.
Or as a quick workaround for an instrumentation bug, when byte code in one specific class is problematic.
This option should not be used lightly, as it can leave some instrumentation partially applied, which could have unknown side-effects.
If you find yourself needing to use this, it would be great if you could drop us an issue explaining why, so that we can try to come up with a better solution to address your need.
System property | Environment variable | Purpose |
---|---|---|
otel.javaagent.exclude-classes | OTEL_JAVAAGENT_EXCLUDE_CLASSES | Suppresses all instrumentation for specific classes, format is "my.package.MyClass,my.package2.*" |
You can suppress all auto instrumentations but have support for manual instrumentation with @WithSpan
and normal API interactions by using
-Dotel.instrumentation.default-enabled=false -Dotel.instrumentation.opentelemetry-annotations.enabled=true
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。