Valid PCA Dumps shared by EduDump.com for Helping Passing PCA Exam! EduDump.com now offer the newest PCA exam dumps, the EduDump.com PCA exam questions have been updated and answers have been corrected get the newest EduDump.com PCA dumps with Test Engine here:
How would you add text from the instance label to the alert's description for the following alert? alert: InstanceDown expr: up == 0 for: 5m labels: severity: page annotations: description: "Instance INSTANCE_NAME_HERE down"
Correct Answer: A
In Prometheus alerting rules, you can dynamically reference label values in annotations and labels using template variables. Each alert has access to its labels via the variable $labels, which allows direct insertion of label data into alert messages or descriptions. To include the value of the instance label dynamically in the description, replace the placeholder INSTANCE_NAME_HERE with: description: "Instance {{$labels.instance}} down" or equivalently: description: "Instance $labels.instance down" Both forms are valid - the first follows Go templating syntax and is the recommended format. This ensures that when the alert fires, the instance label (e.g., a hostname or IP) is automatically included in the message, producing outputs like: Instance 192.168.1.15:9100 down Options B, C, and D are invalid because $value, $expr, and $metric are not recognized context variables in alert templates. Reference: Verified from Prometheus documentation - Alerting Rules Configuration, Using Template Variables in Annotations and Labels, and Prometheus Templating Guide (Go Templates and $labels usage) sections.