Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
D
docs
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Administrator
docs
Commits
624029dc
Commit
624029dc
authored
Jul 15, 2016
by
Brian Brazil
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Sort SDs in docs
parent
59a91046
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
157 additions
and
158 deletions
+157
-158
configuration.md
content/docs/operating/configuration.md
+157
-158
No files found.
content/docs/operating/configuration.md
View file @
624029dc
...
...
@@ -157,33 +157,33 @@ basic_auth:
tls_config:
[ <tls_config> ]
# List of Consul service discovery configurations.
consul_sd_configs:
[ - <consul_sd_config> ... ]
# List of DNS service discovery configurations.
dns_sd_configs:
[ - <dns_sd_config> ... ]
# List of Consul service discovery configurations.
consul_sd_configs:
[ - <consul_sd_config> ... ]
# List of EC2 service discovery configurations.
ec2_sd_configs:
[ - <ec2_sd_config> ... ]
# List of file service discovery configurations.
file_sd_configs:
[ - <file_sd_config> ... ]
# List of Kubernetes service discovery configurations.
kubernetes_sd_configs:
[ - <kubernetes_sd_config> ... ]
# List of Zookeeper Serverset service discovery configurations.
serverset_sd_configs:
[ - <serverset_sd_config> ... ]
# List of AirBnB's Nerve service discovery configurations.
nerve_sd_configs:
[ - <nerve_sd_config> ... ]
# List of EC2 service discovery configurations.
ec2_sd_configs:
[ - <ec2_sd_config> ... ]
# List of file service discovery configurations.
file_sd_configs:
[ - <file_sd_config> ... ]
# List of Zookeeper Serverset service discovery configurations.
serverset_sd_configs:
[ - <serverset_sd_config> ... ]
# List of labeled statically configured targets for this job.
# Known as target_groups prior to v0.20.
...
...
@@ -224,26 +224,46 @@ A `tls_config` allows configuring TLS connections.
[ insecure_skip_verify: <boolean> ]
```
### `<consul_sd_config>`
### `<static_config>`
Consul SD configurations allow retrieving scrape targets from
[
Consul's
](
https://www.consul.io
)
Catalog API.
A
`static_config`
allows specifying a list of targets and a common label set
for them. It is the canonical way to specify static targets in a scrape
configuration.
The following meta labels are available on targets during relabeling:
```
# The targets specified by the static config.
targets:
[ - '<host>' ]
*
`__meta_consul_address`
: the address of the target
*
`__meta_consul_node`
: the node name defined for the target
*
`__meta_consul_tags`
: the list of tags of the target joined by the tag separator
*
`__meta_consul_service`
: the name of the service the target belongs to
*
`__meta_consul_service_address`
: the service address of the target
*
`__meta_consul_service_port`
: the service port of the target
*
`__meta_consul_service_id`
: the service ID of the target
*
`__meta_consul_dc`
: the datacenter name for the target
# Labels assigned to all metrics scraped from the targets.
labels:
[ <labelname>: <labelvalue> ... ]
```
# The information to access the Consul API. It is to be defined
# as the Consul documentation requires.
server: <host>
[ token: <string> ]
[ datacenter: <string> ]
[ scheme: <string> ]
[ username: <string> ]
[ password: <string> ]
Where
`<host>`
is a valid string consisting of a hostname or IP followed by a port
number.
# A list of services for which targets are retrieved. If omitted, all services
# are scraped.
services:
[ - <string> ]
# The string by which Consul tags are joined into the tag label.
[ tag_separator: <string> | default = , ]
```
Note that the IP number and port used to scrape the targets is assembled as
`<__meta_consul_address>:<__meta_consul_service_port>`
. However, in some
Consul setups, the relevant address is in
`__meta_consul_service_address`
.
In those cases, you can use the
[
relabel
](
#relabel_config
)
feature to replace the special
`__address__`
label.
### `<dns_sd_config>`
...
...
@@ -273,46 +293,93 @@ names:
Where
`<record_name>`
is any DNS SRV record name.
Where
`<query_type>`
is
`SRV`
,
`A`
, or
`AAAA`
.
### `<
consul
_sd_config>`
### `<
ec2
_sd_config>`
Consul SD configurations allow retrieving scrape targets from
[
Consul's
](
https://www.consul.io
)
Catalog API.
CAUTION: EC2 SD is in beta: breaking changes to configuration are still
likely in future releases.
EC2 SD configurations allow retrieving scrape targets from AWS EC2
instances. The private IP address is used by default, but may be changed to
the public IP address with relabeling.
The following meta labels are available on targets during relabeling:
*
`__meta_consul_address`
: the address of the target
*
`__meta_consul_node`
: the node name defined for the target
*
`__meta_consul_tags`
: the list of tags of the target joined by the tag separator
*
`__meta_consul_service`
: the name of the service the target belongs to
*
`__meta_consul_service_address`
: the service address of the target
*
`__meta_consul_service_port`
: the service port of the target
*
`__meta_consul_service_id`
: the service ID of the target
*
`__meta_consul_dc`
: the datacenter name for the target
*
`__meta_ec2_availability_zone`
: the availability zone in which the instance is running
*
`__meta_ec2_instance_id`
: the EC2 instance ID
*
`__meta_ec2_private_ip`
: the private IP address of the instance, if present
*
`__meta_ec2_public_dns_name`
: the public DNS name of the instance, if available
*
`__meta_ec2_public_ip`
: the public IP address of the instance, if available
*
`__meta_ec2_subnet_id`
: comma separated list of subnets IDs in which the instance is running, if available
*
`__meta_ec2_tag_<tagkey>`
: each tag value of the instance
*
`__meta_ec2_vpc_id`
: the ID of the VPC in which the instance is running, if available
See below for the configuration options for EC2 discovery:
```
# The information to access the Consul API. It is to be defined
# as the Consul documentation requires.
server: <host>
[ token: <string> ]
[ datacenter: <string> ]
[ scheme: <string> ]
[ username: <string> ]
[ password: <string> ]
# The information to access the EC2 API.
# A list of services for which targets are retrieved. If omitted, all services
# are scraped.
services:
[ - <string> ]
# The AWS Region.
region: <string>
# The string by which Consul tags are joined into the tag label.
[ tag_separator: <string> | default = , ]
# The AWS API keys. If blank, the environment variables `AWS_ACCESS_KEY_ID`
# and `AWS_SECRET_ACCESS_KEY` are used.
[ access_key: <string> ]
[ secret_key: <string> ]
# Refresh interval to re-read the instance list.
[ refresh_interval: <duration> | default = 60s ]
# The port to scrape metrics from. If using the public IP address, this must
# instead be specified in the relabeling rule.
[ port: <int> | default = 80 ]
```
Note that the IP number and port used to scrape the targets is assembled as
`<__meta_consul_address>:<__meta_consul_service_port>`
. However, in some
Consul setups, the relevant address is in
`__meta_consul_service_address`
.
In those cases, you can use the
[
relabel
](
#relabel_config
)
feature to replace the special
`__address__`
label.
### `<file_sd_config>`
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.
It reads a set of files containing a list of zero or more
`<static_config>`
s. Changes to all defined files are detected via disk watches
and applied immediately. Files may be provided in YAML or JSON format. Only
changes resulting in well-formed target groups are applied.
The JSON file must contain a list of static configs, using this format:
```
[
{
"targets": [ "<host>", ... ],
"labels": {
"<labelname>": "<labelvalue>", ...
}
},
...
]
```
As a fallback, the file contents are also re-read periodically at the specified
refresh interval.
Each target has a meta label
`__meta_filepath`
during the
[
relabeling phase
](
#relabel_config
)
. Its value is set to the
filepath from which the target was extracted.
```
# Patterns for files from which target groups are extracted.
files:
[ - <filename_pattern> ... ]
# Refresh interval to re-read the files.
[ refresh_interval: <duration> | default = 30s ]
```
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`
.
NOTE: Prior to v0.20,
`names:`
was used instead of
`files:`
.
### `<kubernetes_sd_config>`
...
...
@@ -459,36 +526,6 @@ Prometheus relabeling to control which instances will actually be scraped. Also
by default all apps will show up as a single job in Prometheus (the one specified
in the configuration file), which can also be changed using relabeling.
### `<serverset_sd_config>`
Serverset SD configurations allow retrieving scrape targets from
[
Serversets
]
(https://github.com/twitter/finagle/tree/master/finagle-serversets) which are
stored in
[
Zookeeper
](
https://zookeeper.apache.org/
)
. Serversets are commonly
used by
[
Finagle
](
https://twitter.github.io/finagle/
)
and
[
Aurora
](
http://aurora.apache.org/
)
.
The following meta labels are available on targets during relabeling:
*
`__meta_serverset_path`
: the full path to the serverset member node in Zookeeper
*
`__meta_serverset_endpoint_host`
: the host of the default endpoint
*
`__meta_serverset_endpoint_port`
: the port of the default endpoint
*
`__meta_serverset_endpoint_host_<endpoint>`
: the host of the given endpoint
*
`__meta_serverset_endpoint_port_<endpoint>`
: the port of the given endpoint
*
`__meta_serverset_shard`
: the shard number of the member
*
`__meta_serverset_status`
: the status of the member
```
# The Zookeeper servers.
servers:
- <host>
# Paths can point to a single serverset, or the root of a tree of serversets.
paths:
- <string>
[ timeout: <duration> | default = 10s ]
```
Serverset data must be in the JSON format, the Thrift format is not currently supported.
### `<nerve_sd_config>`
Nerve SD configurations allow retrieving scrape targets from
[
AirBnB's Nerve
]
...
...
@@ -512,93 +549,55 @@ paths:
[ timeout: <duration> | default = 10s ]
```
### `<ec2_sd_config>`
CAUTION: EC2 SD is in beta: breaking changes to configuration are still
likely in future releases.
### `<serverset_sd_config>`
EC2 SD configurations allow retrieving scrape targets from AWS EC2
instances. The private IP address is used by default, but may be changed to
the public IP address with relabeling.
Serverset SD configurations allow retrieving scrape targets from
[
Serversets
]
(https://github.com/twitter/finagle/tree/master/finagle-serversets) which are
stored in
[
Zookeeper
](
https://zookeeper.apache.org/
)
. Serversets are commonly
used by
[
Finagle
](
https://twitter.github.io/finagle/
)
and
[
Aurora
](
http://aurora.apache.org/
)
.
The following meta labels are available on targets during relabeling:
*
`__meta_ec2_availability_zone`
: the availability zone in which the instance is running
*
`__meta_ec2_instance_id`
: the EC2 instance ID
*
`__meta_ec2_private_ip`
: the private IP address of the instance, if present
*
`__meta_ec2_public_dns_name`
: the public DNS name of the instance, if available
*
`__meta_ec2_public_ip`
: the public IP address of the instance, if available
*
`__meta_ec2_subnet_id`
: comma separated list of subnets IDs in which the instance is running, if available
*
`__meta_ec2_tag_<tagkey>`
: each tag value of the instance
*
`__meta_ec2_vpc_id`
: the ID of the VPC in which the instance is running, if available
See below for the configuration options for EC2 discovery:
*
`__meta_serverset_path`
: the full path to the serverset member node in Zookeeper
*
`__meta_serverset_endpoint_host`
: the host of the default endpoint
*
`__meta_serverset_endpoint_port`
: the port of the default endpoint
*
`__meta_serverset_endpoint_host_<endpoint>`
: the host of the given endpoint
*
`__meta_serverset_endpoint_port_<endpoint>`
: the port of the given endpoint
*
`__meta_serverset_shard`
: the shard number of the member
*
`__meta_serverset_status`
: the status of the member
```
# The information to access the EC2 API.
# The AWS Region.
region: <string>
# The AWS API keys. If blank, the environment variables `AWS_ACCESS_KEY_ID`
# and `AWS_SECRET_ACCESS_KEY` are used.
[ access_key: <string> ]
[ secret_key: <string> ]
# Refresh interval to re-read the instance list.
[ refresh_interval: <duration> | default = 60s ]
# The port to scrape metrics from. If using the public IP address, this must
# instead be specified in the relabeling rule.
[ port: <int> | default = 80 ]
# The Zookeeper servers.
servers:
- <host>
# Paths can point to a single serverset, or the root of a tree of serversets.
paths:
- <string>
[ timeout: <duration> | default = 10s ]
```
### `<file_sd_config>`
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.
It reads a set of files containing a list of zero or more
`<static_config>`
s. Changes to all defined files are detected via disk watches
and applied immediately. Files may be provided in YAML or JSON format. Only
changes resulting in well-formed target groups are applied.
The JSON file must contain a list of static configs, using this format:
```
[
{
"targets": [ "<host>", ... ],
"labels": {
"<labelname>": "<labelvalue>", ...
}
},
...
]
```
Serverset data must be in the JSON format, the Thrift format is not currently supported.
As a fallback, the file contents are also re-read periodically at the specified
refresh interval.
### `<static_config>`
Each target has a meta label
`__meta_filepath`
during the
[
relabeling phase
](
#relabel_config
)
. Its value is set to th
e
filepath from which the target was extracted
.
A
`static_config`
allows specifying a list of targets and a common label set
for them. It is the canonical way to specify static targets in a scrap
e
configuration
.
```
#
Patterns for files from which target groups are extracted
.
file
s:
[ -
<filename_pattern> ...
]
#
The targets specified by the static config
.
target
s:
[ -
'<host>'
]
# Refresh interval to re-read the files.
[ refresh_interval: <duration> | default = 30s ]
# Labels assigned to all metrics scraped from the targets.
labels:
[ <labelname>: <labelvalue> ... ]
```
Where
`<
filename_pattern>`
may be a path ending in
`.json`
,
`.yml`
or
`.yaml`
. The last path segmen
t
may contain a single
`*`
that matches any character sequence, e.g.
`my/path/tg_*.json`
.
Where
`<
host>`
is a valid string consisting of a hostname or IP followed by a por
t
number
.
NOTE: Prior to v0.20,
`names:`
was used instead of
`files:`
.
### `<relabel_config>`
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment