Upgrade to Pro — share decks privately, control downloads, hide ads and more …

The Complete Handbook to OpenTelemetry Metrics

The Complete Handbook to OpenTelemetry Metrics

This talk goes deep into understanding OpenTelemetry Metrics.

Abstract
You have heard of OpenTelemetry in the context of traces. But did you know OpenTelemetry also supports metrics with a forward-looking data model? This talk will demystify everything about Otel Metrics, the data model, and the differences between Otel Metrics and Prometheus

Related Reading

If you don't know what is OpenTelemetry -> Read here What is OpenTemetry and What is OpenTelemetry Collector

Prometheus Metrics Types

Prathamesh Sonpatki

January 25, 2024
Tweet

More Decks by Prathamesh Sonpatki

Other Decks in Programming

Transcript

  1. Agenda - Why should you care? - Prometheus vs. OpenTelemetry

    Metrics - OpenTelemetry Collector - OpenTelemetry Semantic Conventions - Conversion Gotchas - Temporality - Cumulative vs. Delta - OpenTelemetry <> Prometheus @ Today - OpenTelemetry <> Prometheus @ Tomorrow 3
  2. Why should you care? - OpenTelemetry is gaining wild attention

    and adoption is 🚀. - It brings standardization. - Vendor neutrality. - Signal correlation. - Support for more languages and SDKs for Otel metrics. - Native support for OpenTelemetry Metrics in Prometheus is 🏗. 4
  3. Prometheus - Scrape metrics from /metrics - Optionally write to

    Remote Write Storages like Levitate - Data is reported in Cumulatives 6
  4. Prometheus - Text Exposition Format - OpenMetrics Format - Float

    values - Label based data model - Pull based scrape model 7
  5. OpenTelemetry - OpenTelemetry is a collection of APIs, SDKs, and

    tools. - Use it to instrument, generate, collect, and export telemetry data (metrics, logs, and traces) to help you analyze your software’s performance and behavior. - OpenTelemetry is GA. From https://opentelemetry.io 8
  6. OpenTelemetry Middleware Tools 10 Otel Collector Otel Operator Connects source

    to destination Manages Collectors, self service instrumentation in K8s
  7. OpenTelemetry 11 - OpenTelemetry does not have storage backends. -

    It can work with multiple backends such as Levitate, Prometheus, New Relic, Datadog.
  8. The OpenTelemetry Promise - Vendor neutral - Semantic Conventions -

    Signal Correlation - Better Performance? 12
  9. OpenTelemetry Metrics Project Goals - Being able to connect metrics

    to other signals. - Providing a path to OpenCensus customers to migrate to OpenTelemetry - Working with existing metrics instrumentation standards and protocols such as Prometheus and statsD. From https://opentelemetry.io/docs/specs/otel/metrics/ 13
  10. Processors 21 - Metric Transformation - Rename - Drop -

    Aggregate - High Cardinality workflows
  11. Exporters 22 - Scrape /metrics exposed by Collector - Remote

    Write from collector to long term storage like Levitate - OTLP push to Prometheus https://last9.io/blog/native-support-for-opentelemetry-metrics-in-prometheus/
  12. Shipping Otel Metrics to Prometheus 23 - Different Metric Types!

    - Cumulative vs. Delta Temporality! - Different naming conventions! - Different data types! - Out of Order Metrics!
  13. Different Metric Types 24 Otel Metrics - Counter - Asynchronous

    Counter - UpDown Counter - Asynchronous UpDown Counter - Gauge - Histogram Prometheus Metrics - Counter - Gague - Summary - Histogram - Sparse Histograms
  14. Cumulative vs. Delta 25 - Cumulative temporality means that the

    value will be the overall value since the start of the measurement. - Delta temporality means that the value will be the difference in the measurement since the last time it was reported.
  15. Naming Conventions 26 - Otel → http.requests.duration with unit milliseconds

    - Prometheus → http_requests_duration_milliseconds_count - Prometheus receiver & exporters support normalization - No conversion between units - Prometheus -> Otel Metrics is also possible
  16. OpenTelemetry Metrics @ Today - API Specification - SDKs -

    Collector - Exporters - Processors - Receivers - Push vs. Pull mechanism 27
  17. Prometheus <> OpenTelemetry @ Tomorrow soon.. 28 - OOO support

    enhancement - UTF-8 support for label and metric names - Delta Temporality support - Handle OTEL resource attributes - Store metric metadata in Prometheus - Performance improvements
  18. Recap - Why should you care? - Prometheus vs. OpenTelemetry

    Metrics - OpenTelemetry Collector - OpenTelemetry Semantic Conventions - Conversion Gotchas - Temporality - Cumulative vs. Delta - OpenTelemetry <> Prometheus @ Today - OpenTelemetry <> Prometheus @ Tomorrow 29