PCA Service Discovery & Targets Flashcards
6 cards from real PCA practice questions. Tap to flip, then mark Knew It or Still Learning โ missed cards come back until you master them.
Read the first 6 PCA Service Discovery & Targets flashcards as text
What does the `labelmap` action in relabel_configs do?
Answer: Copies all labels matching a regex into new labels with transformed names
labelmap matches existing label names against a regex and creates new labels with names derived from the match groups.
Which EC2 metadata label exposed by ec2_sd_configs contains the instance's private IP address?
Answer: __meta_ec2_private_ip
ec2_sd_configs exposes __meta_ec2_private_ip containing the private IP of each discovered EC2 instance.
What is the default scrape path Prometheus uses if `__metrics_path__` is not set for a target?
Answer: /metrics
Prometheus scrapes the /metrics path by default when no custom __metrics_path__ label is provided.
In Prometheus, what is the role of `source_labels` in a relabel_configs entry?
Answer: They specify which existing labels are read as input for the relabeling action
source_labels selects the labels whose concatenated values are tested against the relabeling regex.
Which Prometheus service discovery type polls an HTTP endpoint that returns a JSON list of targets?
Answer: http_sd_configs
http_sd_configs retrieves scrape targets by calling an HTTP URL that returns a JSON-formatted target list.
What happens to labels prefixed with `__` after the relabeling phase in Prometheus?
Answer: They are dropped and not attached to scraped metrics
Double-underscore labels are reserved for internal use and are removed after the relabeling phase; they never appear on scraped metrics.