Logico_jp explains how to enable metrics, log, and trace telemetry for Micronaut applications, including GraalVM Native Images, on Azure Monitor. The article discusses integration options and the recently introduced micronaut-azure-tracing dependency.

Sending Metrics, Logs, and Traces from Micronaut Native Image Applications to Azure Monitor

Author: Logico_jp

Overview

This guide addresses how to collect and send metrics, logs, and traces from Micronaut-based applications running on Azure, including support for GraalVM Native Images, leveraging the latest updates in the Micronaut ecosystem.

Customer Query

A customer using Micronaut for microservices on Azure Container Apps requested:

  • How to send traces (beyond logs/metrics) to Azure Monitor.
  • Whether this works with GraalVM Native Image builds.

Context: Existing Solutions in Java Frameworks

Java frameworks like Spring Boot and Quarkus offer built-in dependencies to facilitate Azure Monitor integration:

Options to Enable Telemetry in Micronaut on Azure

1. Java Agent

  • Easiest to use for Java applications.
  • Drawbacks: Increased startup time; not compatible with Native Images as of July 2025.

2. Fat JAR with Micronaut Dependencies

  • Use dependencies like io.micronaut.micrometer:micronaut-micrometer-registry-azure-monitor and io.micronaut.azure:micronaut-azure-logging for metrics and logs.
  • Previously, no direct dependency for traces.

3. Azure Monitor Agent with OpenTelemetry Protocol (OTLP)

  • Enable Azure Monitor Agent in Azure Container Apps environment.
  • Works with any application stack.
  • Limitation: Cannot send metrics (per Microsoft docs).

Recent Improvements — Trace Support for Micronaut Native Images

As of Micronaut 4.9.0, the new dependency io.micronaut.azure:micronaut-azure-tracing enables sending traces to Application Insights. This is powered by the Azure Monitor OpenTelemetry SDK Autoconfigure Distro, not by the Azure Monitor Agent.

Key Considerations for Sending Telemetry

  • Use Micronaut dependencies for logs/metrics/traces:
    • Metrics: micronaut-micrometer-registry-azure-monitor
    • Logs: micronaut-azure-logging
    • Traces: micronaut-azure-tracing (since 4.9.0)
  • For Azure Container Apps:
    • Agent-based OTLP is simple, but does not handle metrics.
    • Fat JAR with dependencies allows full coverage, including traces in Native Images.

Conclusion

Micronaut 4.9.0 introduces direct support for sending traces to Azure Monitor from both JAR and GraalVM Native Image applications using the micronaut-azure-tracing dependency. Combined with logging and metrics dependencies, this enables comprehensive observability for Micronaut applications on Azure.

This post appeared first on “Microsoft Tech Community”. Read the entire article here