Description
Some libraries/frameworks instrumented by OpenTelemetry have a "standalone library instrumentation" (see table) which does not require the OTel Java agent. OTel standalone library instrumentation is added to an application as a dependency and essentially provides an SDK that can be used to add OTel instrumentation to the application.
The way that each standalone library instrumentation is integrated varies depending on the specific library/framework that it is being used to instrument. For example, the standalone library instrumentation for the Armeria framework is added as a decorator to the client and server builders:
// Add OTel ArmeriaTelemetry decorator to ServerBuilder
final ServerBuilder sb = Server.builder().decorator(ArmeriaTelemetry.builder(openTelemetry).build().newServiceDecorator());
// Add OTel ArmeriaTelemetry decorator to WebClientBuilder
WebClientBuilder wcb = WebClient.builder(uri).decorator(ArmeriaTelemetry.builder(openTelemetry).build().newClientDecorator());
We could potentially write our own weave instrumentation module that instruments these builder APIs and injects the standalone library instrumentation automatically. The purpose of this story is to pick out a couple of libraries that have OTel standalone library instrumentation and that we don't otherwise support and to explore the feasibility of such an approach.
Ultimately, depending on the complexity of writing weaver instrumentation to inject OTel standalone library instrumentation, it might just make more sense to write a proper weaver instrumentation module for said library/framework and avoid any dependency on OTel.
Metadata
Metadata
Assignees
Labels
Type
Projects
Status