Understanding Prometheus Metric Types | Meaning and Usage (Gauge, Counter, Summary, Histogram)

Поділитися
Вставка
  • Опубліковано 19 тра 2024
  • This video explains the four different metric types in Prometheus: Gauges, Counters, Summaries, and Histograms. It goes into the meaning of each type, explains how to use each type in instrumentation, and how they show up in the exposition format. It also touches on what you have to watch out for when querying each metric type with PromQL.
    Check my Prometheus training courses if you want to learn Prometheus in a structured way from the ground up:
    training.promlabs.com/
    Histograms vs. Summaries in the Prometheus documentation:
    prometheus.io/docs/practices/...
    Chapters:
    00:00 Introduction
    00:25 Gauges
    01:00 Gauge Instrumentation Methods
    01:40 Gauges in the Exposition Format
    01:50 Querying Gauges
    02:05 Gauges Containing Timestamps
    02:18 Counters
    02:44 Counter Resets
    02:56 Counter Instrumentation Methods
    03:48 Counters in the Exposition Format
    03:58 Querying Counters (absolute values vs. rates)
    04:53 Summaries
    05:05 Constructing Summaries
    05:15 Summary Instrumentation Methods
    05:37 Summaries in the Exposition Format
    06:01 Querying Summaries
    06:45 Histograms
    07:10 Cumulative Histograms
    07:48 Constructing Histograms
    07:58 Histogram Instrumentation Methods
    08:08 Histograms in the Exposition Format
    09:05 Querying Histograms (percentile calculation using histogram_quantile() )
    10:10 Average Request Latencies
    10:29 Native Histograms
    11:04 Outro & PromLabs Prometheus Trainings
    ---------------------------------------------------------------------------
    CREDITS: "Subscribe Button" by MrNumber112 • Free Download: Subscri...
  • Наука та технологія

КОМЕНТАРІ • 21

  • @ankitshah8369
    @ankitshah8369 2 місяці тому +8

    The Prometheus CO-FOUNDER is out here explaining these concepts, and doing them so well. What a legend! Easiest sub ever. Thanks Julius!!!

  • @abdussamisehaam2523
    @abdussamisehaam2523 15 днів тому +1

    hey julius... your way of explaining is super simple and on-point. the way you speak steadily and clearly..it made the concepts so easy to understand. keep bringing more videos on grafana and prometheus.

  • @user-mn8hm2fe1v
    @user-mn8hm2fe1v 9 місяців тому +3

    We recently started using it in our production, thank you so much for your work and for these videos. Hope to see them more 🙏

  • @manumonti_
    @manumonti_ 9 місяців тому +1

    Thanks! This video covers just what I wanted to know

  • @denar5022
    @denar5022 7 місяців тому +2

    Thank you very much for the amazing videos! Very informative

  • @cokegen
    @cokegen 10 місяців тому +1

    Thanks a ton ! I'm re-watching this and a couple more of your videos till the "dust settles" ...

  • @metalmasterlp
    @metalmasterlp Рік тому +2

    Amazing explanation, thanks for sharing

  • @VishalSharma-rl1ko
    @VishalSharma-rl1ko Рік тому +7

    Thanks for this video.
    Would like to know more about native histogram.

    • @PromLabs
      @PromLabs  Рік тому

      Thanks! Yes, I'll definitely make a video about those at some point! In the meantime, maybe these videos from PromCon EU 2022 are interesting: ua-cam.com/video/AcmABV6NCYk/v-deo.html and ua-cam.com/video/fikCqhlUOmQ/v-deo.html

  • @joshuabrard1061
    @joshuabrard1061 Рік тому +1

    Thanks for the video!

  • @user-bc2vi4lo1z
    @user-bc2vi4lo1z 8 місяців тому +1

    It might set the context better for a first time watcher, if instrumentation is mentioned briefly.

  • @Jam-ht2ky
    @Jam-ht2ky Рік тому +1

    🙏🙏🙏🙏🙏 thank you soo much

  • @catex5452
    @catex5452 26 днів тому

    I have a datetime value I want to track with metrics and prometheus. What would be the ideal metric type for that job?

    • @PromLabs
      @PromLabs  20 днів тому

      A common pattern in Prometheus is to store Unix timestamps in gauge metrics. Then you can use the time() function (e.g. "time() - my_timestamp_seconds") to calculate how old the timestamp is. Example: demo.promlens.com/?l=e2HGvJ2PJgl

  • @JackReacher1
    @JackReacher1 15 днів тому +1

    thanks for the video but the subscriber button has a very different kind of inc() method it substracts one if you are already subscribed :)

    • @PromLabs
      @PromLabs  6 днів тому

      Haha yes, this is very dangerous 🤣

  • @sriyushanyanshunamana4651
    @sriyushanyanshunamana4651 4 місяці тому

    when I am trying to create datasource using local prometheus url in grafana its throwing an error "ReadObject: expect { or , or } or n, but found #, error found in #1 byte of ...|# HELP jmx_|..., bigger context ...|# HELP jmx_config_reload_success_total Number of ti|... - There was an error returned querying the Prometheus API." how to resolve this .Any body help me

    • @PromLabs
      @PromLabs  3 місяці тому

      It sounds like you are inputting the URL of a Prometheus /metrics endpoint (perhaps of the JMX exporter), not the URL to a Prometheus monitoring server.

  • @vipinmanakkattel9241
    @vipinmanakkattel9241 18 днів тому

    How to enable authentication in prometheus

    • @PromLabs
      @PromLabs  6 днів тому

      There's several ways, but take a look at prometheus.io/docs/guides/basic-auth/ and prometheus.io/docs/prometheus/latest/configuration/https/ for a start.