Logico_jp explains the updated best practices and tooling for sending logs, metrics, and traces from Micronaut (Java) applications—including GraalVM native images—to Azure Monitor, highlighting the new Micronaut Azure tracing integration.

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

Author: Logico_jp

Context and Query

A customer building microservices with Micronaut, orchestrated via Azure Container Apps, inquired about the best approaches for:

  • Sending logs, metrics, and traces from Micronaut apps to Azure Monitor (Application Insights, Log Analytics Workspace)
  • Ensuring compatibility with GraalVM Native Image builds

Spring Boot and Quarkus offer native integrations for observability—does Micronaut have a similar offering?

References:

Available Approaches

1. Use Java Agents

  • Simple setup for standard JVM deployment (instrumentation for logs, metrics, traces)
  • Limitations:
    • Can increase container/application startup time
    • Not supported when building Micronaut apps as GraalVM Native Images

2. FAT JAR with Bound Dependencies

  • Use dependencies such as io.micronaut.micrometer:micronaut-micrometer-registry-azure-monitor and io.micronaut.azure:micronaut-azure-logging to emit metrics and logs
  • Limitations:
    • Until recently, tracing support/status was missing

3. Azure Monitor Agent in Azure Container Apps (OpenTelemetry Protocol)

  • Configure the Azure Container Apps environment to use Azure Monitor Agent and collect OpenTelemetry data
  • Advantage: Works with any language/runtime
  • Limitation: Metrics not supported as of July 2025 (per Microsoft documentation)

Documentation

Recent Change: Micronaut 4.9.0 and Azure Tracing

Starting with Micronaut 4.9.0, a new dependency (io.micronaut.azure:micronaut-azure-tracing) enables sending traces directly to Application Insights, with:

Key Points for Logging, Metrics, and Tracing

  • Logs: Use micronaut-azure-logging dependency
  • Metrics: Use micronaut-micrometer-registry-azure-monitor for exporting via Micrometer
  • Traces: As of Micronaut 4.9.0, use micronaut-azure-tracing (works with native images)

Additional Resources

  • [Send metrics from Micronaut native image applications to Azure Monitor Microsoft Community Hub](https://techcommunity.microsoft.com/blog/appsonazureblog/send-metrics-from-micronaut-native-image-applications-to-azure-monitor/4443763)
  • [Send traces from Micronaut native image applications to Azure Monitor Microsoft Community Hub](https://techcommunity.microsoft.com/blog/appsonazureblog/send-traces-from-micronaut-native-image-applications-to-azure-monitor/4443791)
  • [Send logs from Micronaut native image applications to Azure Monitor Microsoft Community Hub](https://techcommunity.microsoft.com/blog/appsonazureblog/send-logs-from-micronaut-native-image-applications-to-azure-monitor/4443867)
  • Send signals from Micronaut applications to Azure Monitor through zero-code instrumentation

Summary Table of Options

Approach Native Image Support Metrics Logs Traces Notes
Java Agent No Yes Yes Yes Simple, slow startup
Fat JAR + dependencies Yes (for logs/metrics) Yes Yes Partial (now full with new tracing dep) Use recent micronaut-azure-tracing for traces
Azure Monitor Agent (OTLP) Yes No Yes Yes Metrics not yet supported

Conclusion

Micronaut users targeting Azure can now achieve full observability—including traces—in Native Image deployments by using the latest Azure tracing dependency. Each observability signal (logs, metrics, traces) may have a tailored integration and set of dependencies—be sure to review the linked documentation for implementation details.

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