Sending Traces to Jaeger

Using the CLI

If you are creating your project using the Micronaut CLI, supply the tracing-jaeger feature to include Jaeger tracing in your project:

  1. $ mn create-app my-app features tracing-jaeger

To send tracing spans to Jaeger the minimal configuration requires you add the following dependencies to build.gradle or pom.xml:

  1. implementation("io.jaegertracing:jaeger-thrift:0.31.0")
  1. <dependency>
  2. <groupId>io.jaegertracing</groupId>
  3. <artifactId>jaeger-thrift</artifactId>
  4. <version>0.31.0</version>
  5. </dependency>

Then you need to enable Jaeger tracing in your configuration (potentially only your production configuration):

application.yml

  1. tracing:
  2. jaeger:
  3. enabled: true

By default Jaeger will be configured to send traces to a locally running Jaeger agent.

Or alternatively if you have the Micronaut CLI installed you can configure Jaeger when creating your service with: mn create-app hello-world —features tracing-jaeger