0 Replies Latest reply on Oct 16, 2019 8:17 AM by monty0

    @Traced annotation questions

    monty0
      Hi, I'm not understanding how to add @Traced annotations and get them to work in Wildfly 17. If there's another, more appropriate, forum to post this please let me know!

       


      I added this to my `pom.xml`

      ```

              <dependency>

                  <groupId>org.eclipse.microprofile.opentracing</groupId>

                  <artifactId>microprofile-opentracing-api</artifactId>

                  <version>1.2.1</version>

                  <scope>provided</scope>

              </dependency>

      ```

      Then in code that gets called during my tests I added

      ```

      import org.eclipse.microprofile.opentracing.Traced;


      ...


          @Traced

          public void someMethod() {...}

      ```


      When I run my load tests against my app, I get traces of the http api methods that are called, but nothing for when those api methods call my `@Traced` methods,except in one class that has these annotations:

      ```

      @RequestScoped

      @Transactional

      @Traced

      ```

      I'm guessing that somehow the @RequestScoped annotation triggers the tracing? But it seems to be more than that, if I just add @RequestScoped to someMethod() above, it doesn't seem to get picked up in the trace. There must be something I'm missing.


      What is the right way to add an `@Traced` annotation and be sure that it gets picked up during a request?


      My next question is going to be how to add such an annotation to my hibernate classes that I don't have direct access to.


      Thanks!


      Monty