20

With OpenTelemetry trying to become the de-facto standard for Observability of applications/services, where does Micrometer fit in? Micrometer website claims that it is SLF4J for metrics, but does it not contradict OpenTelemetry's Metrics APIs? I wonder if OpenTelemetry's Metric APIs should represent SLF4J and Micrometer should represent an implementation like Log4J.

Appreciate if someone can help me clarify this.

Niranjan
  • 2,601
  • 8
  • 43
  • 54

3 Answers3

21

I would say the answer by @checketts is now quite out of date. Metrics are now very prominent within OpenTelemetry, with them being declared stable.

OpenTelemetry and Micrometer share some similarities in the sense that they both have metric APIs. They both have the ability to export a variety of different formats. However Micrometer is Java-specific, while OpenTelemetry has implementations in many languages. The two projects have different goals.

You can use OpenTelemetry with the Micrometer API, by using the OpenTelemetry Meter Registry for Micrometer. This will forward Micrometer's captured metrics into an OpenTelemetry meter.

James Moessis
  • 654
  • 6
  • 8
6

OpenTelemetry is focused on tracing (see zipkin and Jaeger) more than metrics. There is an overlap with Micrometer metrics, but the approach is quite different.

Micrometer is still similar to slf4j since it is the metrics facade for coding to recording metrics. The actual implementation (as you think about log4j) for metrics is Prometheus, Statsd, Datadog, etc.

So OpenTelemetry and Micrometer could both be considered metric abstractions, but since there are different types of metrics (tracing and performance aggregations), they track different things.

Another way to think about this is OpenTelemtry would be useful to measure across many microservices as they hand off requests and you need to trace behavior, while Micrometer would be more useful for tracking a single application's performance and health.

checketts
  • 14,167
  • 10
  • 53
  • 82
  • 15
    I am little confused. 1) What is the differences between metrics supported by OpenTelemetry vs Micrometer? 2) Isn't OpenTelemetry touting to become standard for exporting traces, METRICS and logs? 3) Do I need to enable OpenTelemetrics metrics as well as micrometer for observability? – Mac Oct 22 '20 at 14:56
0

OpenTelemetry Architecture specifies these key components

  1. OpenTelemetry Client (helps application/framework code to do instrumentation, helps collect these metrics, helps expose the metrics to the Collector)
  2. OpenTelemetry Collector (has push-based/pull-based receivers to collect the metrics from the clients, process, and then export to Backends/Databases )
  3. OpenTelemetry Backends/Databases.

Micrometer fits in as part of the Telemetry Client. provides vendor-neutral API to instrument/collect metrics. Micrometer library is Spring's way of doing things. Micrometer along with Spring's actuators form the Telemetry/OpenTelemetry client.