August 2019
Intermediate to advanced
256 pages
6h 43m
English
MicroProfile OpenTracing defines an @Traced annotation that can be used to enable tracing on CDI beans or disable tracing on automatically traced interfaces. The annotation can also be used to override the operation name on other automatically traced components – JAX-RS endpoints.
The following code example shows how the @Traced annotation can be used to enable tracing on a CDI bean. (1) enables tracing for all methods the bean defines. (2) overrides the default operation name (package.className.method) to get_all_users. (3) disables tracing of the health method:
@Traced (1)@ApplicationScopedpublic class Service { @Traced(operationName = "get_all_users") (2) public void getUsers() { // business code } @Traced(false) (3) ...Read now
Unlock full access