How Atoti Server finds the OpenTelemetry instance
The Atoti Server Starter uses the application’sio.opentelemetry.api.OpenTelemetry Spring bean.
Each setup below provides that bean: you declare it in Setups 1 and 3, and the OpenTelemetry Spring Boot starter declares it in Setup 2.
Choose the setup that matches how your application is deployed.
Whichever you choose, the exporters, endpoints and sampling are configured by whatever owns the OpenTelemetry instance, not by Atoti Server.
Setup 1: OpenTelemetry Java agent
Attach the OpenTelemetry Java agent to the JVM and configure it with itsotel.* system properties or OTEL_* environment variables.
Then declare a bean that exposes the agent’s instance to Atoti Server:
Setup 2: OpenTelemetry Spring Boot starter
Without an agent, add the OpenTelemetry Spring Boot starter,io.opentelemetry.instrumentation:opentelemetry-spring-boot-starter, to the application.
It provides the OpenTelemetry bean, with traces, metrics and logs exporters configured through otel.* properties.
No additional code is needed.
Setup 3: OpenTelemetry SDK bean (advanced)
If neither setup fits, build anOpenTelemetry SDK instance yourself and declare it as a bean.
Follow the OpenTelemetry manual setup.
- Traces, metrics and logs are sent only if the SDK is configured with the matching exporters.
- Logs also require the OpenTelemetry Logback appender.
MDC attributes
Atoti Server puts these attributes in the logging MDC:
To export an attribute, enable MDC capture of its name in your OpenTelemetry Logback integration.
The logs written while a request is being authenticated, such as those of the authentication filters, do not carry
user_name.
Known pitfalls
With the agent attached and Micrometer’s tracing bridge active (
micrometer-tracing-bridge-otel and spring-boot-micrometer-tracing-opentelemetry), incoming HTTP, WebClient and GraphQL requests are traced twice.
Suppress the duplicate Spring observations in your application, for example with an ObservationRegistryCustomizer that filters them out with a predicate.