Commit f3a28b59 authored by Brian Brazil's avatar Brian Brazil

Merge pull request #220 from prometheus/external-labels

Document new name and semantics of external labels.
parents 6fb1adb2 540c58b4
...@@ -39,8 +39,9 @@ global: ...@@ -39,8 +39,9 @@ global:
evaluation_interval: 15s # By default, scrape targets every 15 seconds. evaluation_interval: 15s # By default, scrape targets every 15 seconds.
# scrape_timeout is set to the global default (10s). # scrape_timeout is set to the global default (10s).
# Attach these extra labels to all timeseries collected by this Prometheus instance. # Attach these labels to any time series or alerts when communicating with
labels: # external systems (federation, remote storage, Alertmanager).
external_labels:
monitor: 'codelab-monitor' monitor: 'codelab-monitor'
# A scrape configuration containing exactly one endpoint to scrape: # A scrape configuration containing exactly one endpoint to scrape:
......
...@@ -57,8 +57,9 @@ global: ...@@ -57,8 +57,9 @@ global:
# How frequently to evaluate rules by default. # How frequently to evaluate rules by default.
[ evaluation_interval: <duration> | default = 1m ] [ evaluation_interval: <duration> | default = 1m ]
# The labels to add to any timeseries that this Prometheus instance scrapes. # The labels to add to any time series or alerts when communicating with
labels: # external systems (federation, remote storage, Alertmanager).
external_labels:
[ <labelname>: <labelvalue> ... ] [ <labelname>: <labelvalue> ... ]
# Rule files specifies a list of files from which rules are read. # Rule files specifies a list of files from which rules are read.
...@@ -112,8 +113,8 @@ job_name: <name> ...@@ -112,8 +113,8 @@ job_name: <name>
# honor_labels controls how Prometheus handles conflicts between labels that are # honor_labels controls how Prometheus handles conflicts between labels that are
# already present in scraped data and labels that Prometheus would attach # already present in scraped data and labels that Prometheus would attach
# server-side ("job" and "instance" labels, global labels, manually configured # server-side ("job" and "instance" labels, manually configured target
# target labels, and labels generated by service discovery implementations). # labels, and labels generated by service discovery implementations).
# #
# If honor_labels is set to "true", label conflicts are resolved by keeping label # If honor_labels is set to "true", label conflicts are resolved by keeping label
# values from the scraped data and ignoring the conflicting server-side labels. # values from the scraped data and ignoring the conflicting server-side labels.
...@@ -123,6 +124,10 @@ job_name: <name> ...@@ -123,6 +124,10 @@ job_name: <name>
# example "exported_instance", "exported_job") and then attaching server-side # example "exported_instance", "exported_job") and then attaching server-side
# labels. This is useful for use cases such as federation, where all labels # labels. This is useful for use cases such as federation, where all labels
# specified in the target should be preserved. # specified in the target should be preserved.
#
# Note that any globally configured "external_labels" are unaffected by this
# setting. In communication with external systems, they are always applied only
# when a time series does not have a given label yet and are ignored otherwise.
[ honor_labels: <boolean> | default = false ] [ honor_labels: <boolean> | default = false ]
# The URL scheme with which to fetch metrics from targets. # The URL scheme with which to fetch metrics from targets.
...@@ -455,7 +460,7 @@ it gets scraped. Multiple relabeling steps can be configured per scrape configur ...@@ -455,7 +460,7 @@ it gets scraped. Multiple relabeling steps can be configured per scrape configur
They are applied to the label set of each target in order of their appearance They are applied to the label set of each target in order of their appearance
in the configuration file. in the configuration file.
Initially, aside from the configured global and per-target labels, a target's `job` Initially, aside from the configured per-target labels, a target's `job`
label is set to the `job_name` value of the respective scrape configuration. label is set to the `job_name` value of the respective scrape configuration.
The `__address__` label is set to the `<host>:<port>` address of the target. The `__address__` label is set to the `<host>:<port>` address of the target.
After relabeling, the `instance` label is set to the value of `__address__` by default if After relabeling, the `instance` label is set to the value of `__address__` by default if
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment