Javaagent instrumentation tests are run using a fully shaded -javaagent
in order to perform
the same bytecode instrumentation as when the agent is run against a normal app.
There are a few key components that make this possible, described below.
The otel.initializer.jar
property is used to load the shaded instrumentation jar into the
AgentClassLoader
, so that the javaagent jar doesn't need to be re-built each time.
This contains the span and metric exporters that are used.
These are in-memory exporters, so that the tests can verify the spans and metrics being exported.
These exporters and the in-memory data live in the AgentClassLoader
, so tests must access them
using reflection. To simplify this, they store the in-memory data using the OTLP protobuf objects,
so that they can be serialized into byte arrays inside the AgentClassLoader
, then passed back
to the tests and deserialized inside their class loader where they can be verified. The
:testing-common
module (described below) hides this complexity from instrumentation test authors.
This is a custom distro of the javaagent that embeds the :testing:agent-exporter
.
This module provides methods to help verify the span and metric data produced by the
instrumentation, hiding the complexity of accessing the in-memory exporters that live in the
AgentClassLoader
.
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。