Рет қаралды 1,641
In this video, I explain Prometheus histograms (for now only the "classic" ones that have been in Prometheus for around a decade - I will make a separate video about the new "native" histograms once they are stable): What are histograms, why are they useful, how can you instrument your service code with histograms, how are histograms exposed as metrics to Prometheus, and how can we query them in PromQL to get quantiles/percentiles, heatmaps, request rates, or average request durations?
Link to the Prometheus histograms best practices:
prometheus.io/docs/practices/...
Also check out my other Prometheus training courses if you want to learn Prometheus in a structured way from the ground up:
training.promlabs.com/
Chapters:
00:00 Introduction
00:56 Motivation and histogram basics
01:22 Need to measure request durations / latency
01:37 Downsides of using event logging
01:56 Why a single gauge doesn't help us
02:28 Downsides of using Prometheus summary metrics
03:09 Prometheus histogram example for tracking request durations
04:32 How can we expose histograms as time series to Prometheus?
05:11 Cumulative histogram representation
05:40 The special "le" (less-than-or-equal) bucket upper bound label
06:12 Time series exposed from a histogram metric
07:30 Instrumentation - adding histograms to your code
07:44 Adding histograms without additional labels
09:07 Adding histograms with additional labels
10:06 Querying histograms with PromQL
10:44 Querying all bucket series of a histogram
11:23 Querying percentiles / quantiles using histogram_quantile()
13:32 Using rate() or increase() to limit a histogram to recent increases
14:42 Controlling the smoothing time window
15:05 Aggregating histograms and percentiles over label dimensions
17:58 Errors of quantile calculation and bucketing schemas
19:27 Showing histograms as a heatmap
20:36 Querying request rates using _count
20:57 Querying average request durations using _sum and _count
21:28 Outro & PromLabs Trainings
---------------------------------------------------------------------------
CREDITS: "Subscribe Button" by MrNumber112 • Free Download: Subscri...