Prerequisites
This guides is written under the assumption that an OpenTelemetry collector runs at the addresslocalhost:4317.
Readers can easily create such a server from Docker, see
the OpenTelemetry Collector setup.
General structure
The tracing setup is a good fit for a Spring configuration class, so that it can be swapped easily. Create a Spring configuration, make sure it is imported by Spring, and start writing a Bean with theOpenTelemetry
type.
Creating the OpenTelemetry instance
You need to create anOpenTelemetry instance with the desired configuration. You can follow the
OpenTelemetry documentation
to create an instance.
Wiring the OpenTelemetry instance
Now that the OpenTelemetry instance is finished, we have to provide it to the Atoti Server tracing framework.
Import the TracingConfig from our activepivot-server-spring module to take care of this step.
The TracingConfig will autowire the OpenTelemetry bean and provide it to the tracing framework.
Check out the result
Everything is now setup to send application traces, metrics and logs (depending of the configuration) to the collector.Go to your AtotiUI application and create a new Pivot Table with some hierarchies and measures. You can see traces related to the queries.
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.
Going further
- There are many other OpenTelemetry exporters one may want to use, listed there.