Sometimes, the automatic instrumentation does not capture all critical timing information and, therefore, additional trace points are needed. For example, we would like to trace an invocation of a business layer or initialize third-party instrumentation provided by the OpenTracing project (https://github.com/opentracing-contrib).
The explicit instrumentation can be done in three ways:
- Add the @Traced annotation on Context and Dependency Injection (CDI) beans.
- Inject the tracer and create spans manually.
- Initialize third-party instrumentation. The initialization of external instrumentation depends on its own initialization requirements. MicroProfile just has to provide a tracer instance, which is covered in the previous ...