Skip to content

Make opentelemetry-javaagent and OpenTelemetry Spring Boot starter/autoconfigure compatibleΒ #12381

@spockz

Description

@spockz

Is your feature request related to a problem? Please describe.

We develop our applications using Spring Boot based on an in-house framework. This in-house framework (traditionally) takes care of all observability aspects, such as reporting targets and standard (resource/span) tags. Most of the data we set by default is known only after Spring context evaluation.

The framework takes care of this because we have a myriad of different deployment targets using different pipelines and different compute hosts and this mechanism allows is to generate a self-contained binary/jar.

The spring boot starter gives us the customisability of the resources attributes and the automatic determination of OTLP targets, but lacks the wide instrumentation that agent provides.

The agent gives us the broad instrumentation but lacks the (ease) of customisation that the spring boot starter offers. It has mechanisms for customisation through SPI, however, this code runs before the Spring Context is evaluated meaning we need to duplicate code to do the same determinations. Because much of the code is written in the Spring ecosystem and used in the rest of the application as well, we need to duplicate the code, which we would rather avoid.

Describe the solution you'd like

Provide the option for the agent to do all the instrumentation, rewriting bytecode, etc. without initialising the actual OpenTelemetry(SDK) so that can be left to the Spring Boot Autoconfiguration to configure and initialise.

Describe alternatives you've considered

  • Duplicate code for determining the targets and standard attributes
  • Be able to modify OTLP targets after initialisation (this is less critical as the logic is relatively easy to extract and have the values provided as ENV vars.)
  • Be able to modify the default resource attributes after initialisation.

Additional context

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions