Kubernetes and Cloud Native Associate (KCNA) Practice Questions

Kubernetes and Cloud Native Associate (KCNA) exam preparation

Kubernetes and Cloud Native Associate (KCNA) practice questions in English: 180 questions with explanations. The mock exam has 60 questions and 90 minutes.

Kubernetes and Cloud Native Associate (KCNA) free question 10 / 10 · Domain 4: Cloud Native Architecture

You want to expose the number of requests being handled at this moment as a Prometheus metric. According to the Prometheus documentation, which metric type fits?

  1. Summary
  2. Counter
  3. Histogram
  4. Gauge
Show the answer and explanation

Answer: D

Why this is correct
The Prometheus documentation on metric types describes a gauge as 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 for "counts" that can go up and down, like the number of concurrent requests. The number of requests being handled right now rises when requests arrive and falls when they finish, so it is exactly this case. The counter page makes the other side of the rule explicit: do not use a counter to expose a value that can decrease, and use a gauge instead.

Why the other options are wrong
"Counter" … A counter is a cumulative metric that only increases (or resets to zero on restart). The documentation says not to use a counter for a value that can decrease, and gives the number of currently running processes as the example to put in a gauge.
"Histogram" … A histogram samples observations, such as request durations or response sizes, and counts them in configurable buckets. It describes a distribution of values, not one current number that rises and falls.
"Summary" … A summary also samples observations such as request durations and calculates quantiles over a sliding time window. It reports a distribution, not a single current value.

Ask whether the value can go down
If it can decrease (current connections, memory in use, queue length), it is a gauge. If it only accumulates (requests served, errors), it is a counter. Histograms and summaries describe distributions.

Go to the Kubernetes and Cloud Native Associate (KCNA) practice app (10 free questions; purchase unlocks all questions)

See the full practice set