Micrometer

Vendor-neutral metrics facade for JVM applications — analogous to SLF4J for logging but for metrics. Micrometer provides a unified API for recording metrics (Counter, Timer, Gauge, DistributionSummary, LongTaskTimer) and exports to 20+ monitoring backends: Prometheus, Datadog, InfluxDB, CloudWatch, New Relic, Dynatrace, Graphite, and more. Spring Boot Actuator uses Micrometer for all built-in metrics (/actuator/metrics). Micrometer Tracing (formerly Spring Cloud Sleuth) provides distributed tracing alongside metrics. Key concept: meters are tagged for dimensional metrics that Prometheus/Grafana can slice and filter.

Evaluated Mar 06, 2026 (0d ago) v1.12.x
Homepage ↗ Repo ↗ Developer Tools java kotlin metrics prometheus grafana spring-boot observability counter timer gauge
⚙ Agent Friendliness
66
/ 100
Can an agent use this?
🔒 Security
84
/ 100
Is it safe for agents?
⚡ Reliability
89
/ 100
Does it work consistently?

Score Breakdown

⚙ Agent Friendliness

MCP Quality
--
Documentation
88
Error Messages
80
Auth Simplicity
90
Rate Limits
95

🔒 Security

TLS Enforcement
88
Auth Strength
80
Scope Granularity
78
Dep. Hygiene
90
Secret Handling
85

Prometheus endpoint (/actuator/prometheus) must be secured in production — exposes internal metrics. API keys for remote registries (Datadog, InfluxDB) via environment variables. Avoid exposing agent business data via metric tags (PII in tag values).

⚡ Reliability

Uptime/SLA
92
Version Stability
90
Breaking Changes
85
Error Recovery
90
AF Security Reliability

Best When

You're building a Spring Boot or JVM agent service and need production-grade metrics exported to Prometheus/Datadog/InfluxDB — Micrometer is already included in Spring Boot Actuator and requires minimal setup.

Avoid When

You're not on the JVM, you want unified traces+metrics via OpenTelemetry from the start, or your monitoring backend isn't supported (check micrometer.io for registry list).

Use Cases

  • Instrument agent service latency and throughput with Micrometer Timer — record agent request duration with tags for agent_type, status, model to enable Grafana dashboards with dimensional filtering
  • Track agent invocation counts using Micrometer Counter — count successful vs failed agent calls, tool invocations, and LLM API requests with custom tags for alerting thresholds
  • Monitor agent queue depth with Micrometer Gauge — expose live agent task queue size as a Prometheus gauge for autoscaling triggers and capacity planning
  • Export agent service metrics to Prometheus with micrometer-registry-prometheus — Spring Boot Actuator auto-configures /actuator/prometheus endpoint for Prometheus scraping
  • Measure agent data pipeline throughput with DistributionSummary — record bytes processed, items transformed, and agent batch sizes with percentile histograms in Prometheus

Not For

  • Distributed tracing — Micrometer Tracing handles traces but OpenTelemetry is the emerging standard; use OpenTelemetry Java SDK for unified traces + metrics if starting fresh
  • Non-JVM applications — Micrometer is JVM-only; use Prometheus client libraries directly, statsd, or OpenTelemetry SDKs for non-JVM agent services
  • Log aggregation — Micrometer is metrics-only; use SLF4J/Logback for structured logging and ELK/Loki for log aggregation

Interface

REST API
No
GraphQL
No
gRPC
No
MCP Server
No
SDK
Yes
Webhooks
No

Authentication

Methods: api_key none
OAuth: No Scopes: No

Micrometer itself needs no auth. Remote registry exports (Datadog, InfluxDB) require API keys configured in application.properties. Prometheus scrapes /actuator/prometheus — secure with Spring Security if exposed externally.

Pricing

Model: open_source
Free tier: Yes
Requires CC: No

Micrometer is Apache 2.0 licensed, maintained by Broadcom/VMware. Free for all use. Backend monitoring services (Datadog, New Relic) have their own pricing.

Agent Metadata

Pagination
none
Idempotent
Full
Retry Guidance
Not documented

Known Gotchas

  • High-cardinality tags cause memory explosion — using agent_user_id, session_id, or request_id as tag values creates one time series per unique value; Prometheus keeps all in memory; limit tags to low-cardinality dimensions (agent_type, status, environment)
  • Timer.record() vs Timer.start/stop — Timer.record(duration) records a completed duration; Timer.Sample sample = Timer.start(registry) followed by sample.stop(timer) measures elapsed wall clock time; using record() with System.currentTimeMillis() is error-prone due to clock choice
  • Percentile histograms require explicit opt-in — by default Micrometer only records count/sum/max; percentile histograms (p50/p95/p99) require .publishPercentileHistogram() on Timer.Builder; adds significant metric cardinality
  • MeterRegistry must be injected, not instantiated — auto-configured Spring Boot registry has all reporters wired; manually creating new MeterRegistry bypasses auto-export; always inject MeterRegistry or use static Metrics.globalRegistry with caution
  • Meter names are dot-separated, not underscore — Micrometer uses dot notation (agent.request.duration); registry adapters transform to backend convention (Prometheus: agent_request_duration_seconds); mixing conventions causes duplicate metrics
  • Gauge requires strong reference to object — Gauge.builder(name, ref, fn) holds weak reference to measured object; if object is garbage collected, gauge reports NaN; ensure gauged objects have application-scoped lifecycle, not request-scoped

Alternatives

Full Evaluation Report

Detailed scoring breakdown, competitive positioning, security analysis, and improvement recommendations for Micrometer.

$99

Scores are editorial opinions as of 2026-03-06.

5208
Packages Evaluated
26151
Need Evaluation
173
Need Re-evaluation
Community Powered