CompTIA Linux+ Practice Questions

CompTIA Linux+ (XK0-006) exam preparation

CompTIA Linux+ practice questions in English: 180 questions with explanations. The mock exam has 90 questions and 90 minutes.

CompTIA Linux+ free question 9 / 10 · Domain 5: Troubleshooting

A Prometheus alerting rule should fire only when its expression has stayed true for 10 minutes, so that short spikes do not page anyone. Which clause of the rule does the Prometheus documentation describe for that?

  1. labels with severity page, the clause that attaches extra labels to the alert
  2. for: 10m, the clause that delays the firing of the alert
  3. keep_firing_for: 10m, the clause that holds the alert firing after the condition was last met
  4. annotations with a summary, the clause that stores descriptions and runbook links
Show the answer and explanation

Answer: B

Why this is correct
The documentation says that the optional for clause causes Prometheus to wait for a certain duration between first encountering a new expression output vector element and counting an alert as firing. With for: 10m, Prometheus checks that the alert continues to be active during each evaluation for 10 minutes before it fires, and elements that are active but not firing yet are in the pending state. Alerting rules without the for clause become active on the first evaluation.

Why the other options are wrong
"keep_firing_for: 10m, the clause that holds the alert firing after the condition was last met" … The page describes keep_firing_for as keeping an alert firing for the specified duration after the firing condition was last met, to prevent flapping alerts. It acts after the condition ends and does not delay the start of firing.
"labels with severity page, the clause that attaches extra labels to the alert" … The page says that the labels clause allows specifying a set of additional labels to be attached to the alert. A label identifies the alert and does not make Prometheus wait before it fires.
"annotations with a summary, the clause that stores descriptions and runbook links" … The page says that the annotations clause specifies informational labels used to store longer additional information such as alert descriptions or runbook links. It carries text for people and has no effect on when the alert fires.

Key points
for delays the start of firing and keep_firing_for delays the end. labels and annotations describe the alert and do not change when it fires.

Go to the CompTIA Linux+ practice app (10 free questions; purchase unlocks all questions)

See the full practice set