Kubernetes Nginx Ingress Controller – Metrics with Prometheus

ingresskubernetesmetricsnginxprometheus

I've tried to find a documentation about the metrics exposed by the NGINX ingress controller in Kubernetes but so far I haven't found any reliable source about the metrics and what they mean.

For example, there are three different request_size metrics (sum, bucket, count).

From my guessing sum and count correlate with each other. And to get the average request size I could probably do something like sum by (method) (request_size_sum{...}) / sum by (method) (request_size_count{...}).

But what about bucket and especially what is le?

Best Answer

For metrics itself and some explanations about them, I think the closest and full list is presented on Github issue - Document prometheus metrics

Note! This is about ingress nginx which is kubernetes community driven. Ingress nginx which is developed by nginx inc is a different project so there can be some differences.


As for the types of metrics, this is about Prometheus itself. There are different types of them:

  • counter:

    A counter is a cumulative metric that represents a single monotonically increasing counter whose value can only increase or be reset to zero on restart. For example, you can use a counter to represent the number of requests served, tasks completed, or errors.

  • gauge:

    A gauge is a metric that represents a single numerical value that can arbitrarily go up and down.

    Gauges are typically used for measured values like temperatures or current memory usage, but also "counts" that can go up and down, like the number of concurrent requests.

  • histogram (it's about buckets):

    A histogram samples observations (usually things like request durations or response sizes) and counts them in configurable buckets. It also provides a sum of all observed values.

  • summary:

    Similar to a histogram, a summary samples observations (usually things like request durations and response sizes). While it also provides a total count of observations and a sum of all observed values, it calculates configurable quantiles over a sliding time window.

Please also get familiar with histograms and summaries.

As for le:

le is the canonical abbreviation for "less than or equal".

Find an example of Prometheus queries and explanations