Commit bd24f5b5 authored by beorn7's avatar beorn7

configuration: Update scrape config

parent c87d331e
...@@ -78,9 +78,13 @@ A `scrape_config` section specifies a set of targets and parameters describing h ...@@ -78,9 +78,13 @@ A `scrape_config` section specifies a set of targets and parameters describing h
to scrape them. In the general case, one scrape configuration specifies a single to scrape them. In the general case, one scrape configuration specifies a single
job. In advanced configurations, this may change. job. In advanced configurations, this may change.
Targets may be statically configured via the `target_groups` parameter or Targets may be statically configured via the `static_configs` parameter or
dynamically discovered using one of the supported service-discovery mechanisms. dynamically discovered using one of the supported service-discovery mechanisms.
NOTE: Prior to v0.20, `target_groups` was used instead of `static_configs`.
`target_groups` can still be used alternatively in v0.20 itself, but not in
later versions.
Additionally, `relabel_configs` allow advanced modifications to any Additionally, `relabel_configs` allow advanced modifications to any
target and its labels before scraping. target and its labels before scraping.
...@@ -181,9 +185,10 @@ ec2_sd_configs: ...@@ -181,9 +185,10 @@ ec2_sd_configs:
file_sd_configs: file_sd_configs:
[ - <file_sd_config> ... ] [ - <file_sd_config> ... ]
# List of labeled target groups for this job. # List of labeled statically configured targets for this job.
target_groups: # Known as target_groups prior to v0.20.
[ - <target_group> ... ] static_configs:
[ - <static_config> ... ]
# List of target relabel configurations. # List of target relabel configurations.
relabel_configs: relabel_configs:
...@@ -220,13 +225,14 @@ A `tls_config` allows configuring TLS connections. ...@@ -220,13 +225,14 @@ A `tls_config` allows configuring TLS connections.
``` ```
### `<target_group>` ### `<static_config>`
A `target_group` allows specifying a list of targets and a common label set for them. A `static_confic` allows specifying a list of targets and a common label set
They are the canonical way to specify static targets in a scrape configuration. for them. It is the canonical way to specify static targets in a scrape
configuration.
``` ```
# The targets specified by the target group. # The targets specified by the static config.
targets: targets:
[ - '<host>' ] [ - '<host>' ]
...@@ -517,12 +523,12 @@ region: <string> ...@@ -517,12 +523,12 @@ region: <string>
File-based service discovery provides a more generic way to configure static targets File-based service discovery provides a more generic way to configure static targets
and serves as an interface to plug in custom service discovery mechanisms. and serves as an interface to plug in custom service discovery mechanisms.
It reads a set of files containing a list of zero or more `<target_group>`s. Changes to It reads a set of files containing a list of zero or more
all defined files are detected via disk watches and applied immediately. Files may be `<static_config>`s. Changes to all defined files are detected via disk watches
provided in YAML or JSON format. Only changes resulting in well-formed target groups and applied immediately. Files may be provided in YAML or JSON format. Only
are applied. changes resulting in well-formed target groups are applied.
The JSON file must contain a list of target groups, using this format: The JSON file must contain a list of static configs, using this format:
``` ```
[ [
...@@ -545,7 +551,7 @@ filepath from which the target was extracted. ...@@ -545,7 +551,7 @@ filepath from which the target was extracted.
``` ```
# Patterns for files from which target groups are extracted. # Patterns for files from which target groups are extracted.
names: files:
[ - <filename_pattern> ... ] [ - <filename_pattern> ... ]
# Refresh interval to re-read the files. # Refresh interval to re-read the files.
...@@ -555,6 +561,7 @@ names: ...@@ -555,6 +561,7 @@ names:
Where `<filename_pattern>` may be a path ending in `.json`, `.yml` or `.yaml`. The last path segment Where `<filename_pattern>` may be a path ending in `.json`, `.yml` or `.yaml`. The last path segment
may contain a single `*` that matches any character sequence, e.g. `my/path/tg_*.json`. may contain a single `*` that matches any character sequence, e.g. `my/path/tg_*.json`.
NOTE: Prior to v0.20, `names:` was used instead of `files:`.
### `<relabel_config>` ### `<relabel_config>`
......
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