Courseiva
PCA
PromqlhardMultiple ChoiceObjective-mapped

PCA Promql Practice Question

You are troubleshooting a query and notice that label_replace is being used. What is the primary function of label_replace(v, dst_label, replacement, src_label, regex)?

Answer choices

Why each option matters

Answer the question above first, then reveal the full breakdown to understand why each option is right or wrong.

Correct answer & explanation

It matches a regex against a source label value and writes the result into a destination label.

The label_replace function matches the regex against the value of src_label, and if it matches, sets dst_label to the replacement string.

Answer analysis

Option-by-option breakdown

For each option: why learners choose it and why it is or isn't the right answer here.

  • It renames the Prometheus server instance in federated environments.

    Why it's wrong here

    Federation handles instance naming differently.

  • It drops all time series that do not contain the specified source label.

    Why it's wrong here

    It does not drop series; it modifies label sets.

  • It matches a regex against a source label value and writes the result into a destination label.

    Why this is correct

    Correct. label_replace modifies or creates labels based on regular expression extractions.

  • It replaces the metric name with a new string.

    Why it's wrong here

    Metric names are stored in the special label __name__, but label_replace is generally used for arbitrary labels.

About these practice questions

Courseiva writes every PCA question from scratch — 304 in total, each with an explanation and a wrong-answer breakdown. None are copied from real exams or dumps. Learn why practice questions differ from exam dumps →

How Courseiva writes practice questions · Editorial policy

JA

Written and reviewed by Johnson Ajibi, MSc IT Security

Senior Network & Security Engineer · founder of Courseiva

Last reviewed August 2026 · checked against the official CNCF / Linux Foundation exam blueprint

This PCA practice question is part of Courseiva's free CNCF / Linux Foundation certification practice question bank. Courseiva provides original exam-style practice questions with explanations, topic-based practice, mock exams, readiness tracking, and study analytics to help learners prepare for the PCA exam.