Search code examples
micronautopen-telemetrymicrometer

Micronaut Micrometer Opentelemetry integration


I'm migrating a micronaut-based service that currently users micrometer and opentracing with a statsd exporter to send information to datadog to user opentelemetry instead and send the traces and metrics using otlp exporter.

I've been able to send traces with opentelemtry to datadog, but It seems that micrometer is not integrated by default there.

Do you know if I need to include any additional configuration, like the micormeter opentelemetry bridge, or a different configuration in micronaut will do the trick.

Also, I've found that Executor services and other concurrent resources need to be wrapped in order to propagate automatically the tracing context between threads. Do you know if this behaviour is already happening for framework-provided executor services?

Thank you kindly


Solution

  • Let me separate the things you are talking about a little.

    Metrics

    • Datadog using StatsD: micrometer-registry-statsd
    • Datadog using HTTP: micrometer-registry-datadog
    • Backend using OTLP: micrometer-registry-otlp

    Tracing

    • Brave bridge with Zipkin: micrometer-tracing-bridge-brave AND io.zipkin.reporter2:zipkin-reporter-brave
    • OTel with OTLP: micrometer-tracing-bridge-otel AND io.opentelemetry:opentelemetry-exporter-zipkin

    If Micronaut does not autoconfigure these for you, I would consider opening an issue with a reproducer.

    I don't think Micronaut will wrap ExecutorService/CompletionService for you automatically (I'm not sure it should) but it might worth an issue too.