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
Show 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:
...
@@ -157,33 +157,33 @@ basic_auth:
tls_config:
tls_config:
[ <tls_config> ]
[ <tls_config> ]
# List of Consul service discovery configurations.
consul_sd_configs:
[ - <consul_sd_config> ... ]
# List of DNS service discovery configurations.
# List of DNS service discovery configurations.
dns_sd_configs:
dns_sd_configs:
[ - <dns_sd_config> ... ]
[ - <dns_sd_config> ... ]
# List of Consul service discovery configurations.
# List of EC2 service discovery configurations.
consul_sd_configs:
ec2_sd_configs:
[ - <consul_sd_config> ... ]
[ - <ec2_sd_config> ... ]
# List of file service discovery configurations.
file_sd_configs:
[ - <file_sd_config> ... ]
# List of Kubernetes service discovery configurations.
# List of Kubernetes service discovery configurations.
kubernetes_sd_configs:
kubernetes_sd_configs:
[ - <kubernetes_sd_config> ... ]
[ - <kubernetes_sd_config> ... ]
# List of Zookeeper Serverset service discovery configurations.
serverset_sd_configs:
[ - <serverset_sd_config> ... ]
# List of AirBnB's Nerve service discovery configurations.
# List of AirBnB's Nerve service discovery configurations.
nerve_sd_configs:
nerve_sd_configs:
[ - <nerve_sd_config> ... ]
[ - <nerve_sd_config> ... ]
# List of EC2 service discovery configurations.
# List of Zookeeper Serverset service discovery configurations.
ec2_sd_configs:
serverset_sd_configs:
[ - <ec2_sd_config> ... ]
[ - <serverset_sd_config> ... ]
# List of file service discovery configurations.
file_sd_configs:
[ - <file_sd_config> ... ]
# List of labeled statically configured targets for this job.
# List of labeled statically configured targets for this job.
# Known as target_groups prior to v0.20.
# Known as target_groups prior to v0.20.
...
@@ -224,26 +224,46 @@ A `tls_config` allows configuring TLS connections.
...
@@ -224,26 +224,46 @@ A `tls_config` allows configuring TLS connections.
[ insecure_skip_verify: <boolean> ]
[ 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
The following meta labels are available on targets during relabeling:
for them. It is the canonical way to specify static targets in a scrape
configuration.
```
*
`__meta_consul_address`
: the address of the target
# The targets specified by the static config.
*
`__meta_consul_node`
: the node name defined for the target
targets:
*
`__meta_consul_tags`
: the list of tags of the target joined by the tag separator
[ - '<host>' ]
*
`__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
# A list of services for which targets are retrieved. If omitted, all services
number.
# 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>`
### `<dns_sd_config>`
...
@@ -273,46 +293,93 @@ names:
...
@@ -273,46 +293,93 @@ names:
Where
`<record_name>`
is any DNS SRV record name.
Where
`<record_name>`
is any DNS SRV record name.
Where
`<query_type>`
is
`SRV`
,
`A`
, or
`AAAA`
.
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
)
CAUTION: EC2 SD is in beta: breaking changes to configuration are still
Catalog API.
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:
The following meta labels are available on targets during relabeling:
*
`__meta_consul_address`
: the address of the target
*
`__meta_ec2_availability_zone`
: the availability zone in which the instance is running
*
`__meta_consul_node`
: the node name defined for the target
*
`__meta_ec2_instance_id`
: the EC2 instance ID
*
`__meta_consul_tags`
: the list of tags of the target joined by the tag separator
*
`__meta_ec2_private_ip`
: the private IP address of the instance, if present
*
`__meta_consul_service`
: the name of the service the target belongs to
*
`__meta_ec2_public_dns_name`
: the public DNS name of the instance, if available
*
`__meta_consul_service_address`
: the service address of the target
*
`__meta_ec2_public_ip`
: the public IP address of the instance, if available
*
`__meta_consul_service_port`
: the service port of the target
*
`__meta_ec2_subnet_id`
: comma separated list of subnets IDs in which the instance is running, if available
*
`__meta_consul_service_id`
: the service ID of the target
*
`__meta_ec2_tag_<tagkey>`
: each tag value of the instance
*
`__meta_consul_dc`
: the datacenter name for the target
*
`__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
# The information to access the EC2 API.
# as the Consul documentation requires.
server: <host>
[ token: <string> ]
[ datacenter: <string> ]
[ scheme: <string> ]
[ username: <string> ]
[ password: <string> ]
# A list of services for which targets are retrieved. If omitted, all services
# The AWS Region.
# are scraped.
region: <string>
services:
[ - <string> ]
# The string by which Consul tags are joined into the tag label.
# The AWS API keys. If blank, the environment variables `AWS_ACCESS_KEY_ID`
[ tag_separator: <string> | default = , ]
# 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
### `<file_sd_config>`
`<__meta_consul_address>:<__meta_consul_service_port>`
. However, in some
Consul setups, the relevant address is in
`__meta_consul_service_address`
.
File-based service discovery provides a more generic way to configure static targets
In those cases, you can use the
[
relabel
](
#relabel_config
)
and serves as an interface to plug in custom service discovery mechanisms.
feature to replace the special
`__address__`
label.
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>`
### `<kubernetes_sd_config>`
...
@@ -459,36 +526,6 @@ Prometheus relabeling to control which instances will actually be scraped. Also
...
@@ -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
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.
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_config>`
Nerve SD configurations allow retrieving scrape targets from
[
AirBnB's Nerve
]
Nerve SD configurations allow retrieving scrape targets from
[
AirBnB's Nerve
]
...
@@ -512,93 +549,55 @@ paths:
...
@@ -512,93 +549,55 @@ paths:
[ timeout: <duration> | default = 10s ]
[ timeout: <duration> | default = 10s ]
```
```
### `<ec2_sd_config>`
### `<serverset_sd_config>`
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
Serverset SD configurations allow retrieving scrape targets from
[
Serversets
]
instances. The private IP address is used by default, but may be changed to
(https://github.com/twitter/finagle/tree/master/finagle-serversets) which are
the public IP address with relabeling.
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:
The following meta labels are available on targets during relabeling:
*
`__meta_ec2_availability_zone`
: the availability zone in which the instance is running
*
`__meta_serverset_path`
: the full path to the serverset member node in Zookeeper
*
`__meta_ec2_instance_id`
: the EC2 instance ID
*
`__meta_serverset_endpoint_host`
: the host of the default endpoint
*
`__meta_ec2_private_ip`
: the private IP address of the instance, if present
*
`__meta_serverset_endpoint_port`
: the port of the default endpoint
*
`__meta_ec2_public_dns_name`
: the public DNS name of the instance, if available
*
`__meta_serverset_endpoint_host_<endpoint>`
: the host of the given endpoint
*
`__meta_ec2_public_ip`
: the public IP address of the instance, if available
*
`__meta_serverset_endpoint_port_<endpoint>`
: the port of the given endpoint
*
`__meta_ec2_subnet_id`
: comma separated list of subnets IDs in which the instance is running, if available
*
`__meta_serverset_shard`
: the shard number of the member
*
`__meta_ec2_tag_<tagkey>`
: each tag value of the instance
*
`__meta_serverset_status`
: the status of the member
*
`__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 EC2 API.
# The Zookeeper servers.
servers:
# The AWS Region.
- <host>
region: <string>
# Paths can point to a single serverset, or the root of a tree of serversets.
paths:
# The AWS API keys. If blank, the environment variables `AWS_ACCESS_KEY_ID`
- <string>
# and `AWS_SECRET_ACCESS_KEY` are used.
[ timeout: <duration> | default = 10s ]
[ 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 ]
```
```
### `<file_sd_config>`
Serverset data must be in the JSON format, the Thrift format is not currently supported.
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
### `<static_config>`
refresh interval.
Each target has a meta label
`__meta_filepath`
during the
A
`static_config`
allows specifying a list of targets and a common label set
[
relabeling phase
](
#relabel_config
)
. Its value is set to th
e
for them. It is the canonical way to specify static targets in a scrap
e
filepath from which the target was extracted
.
configuration
.
```
```
#
Patterns for files from which target groups are extracted
.
#
The targets specified by the static config
.
file
s:
target
s:
[ -
<filename_pattern> ...
]
[ -
'<host>'
]
# Refresh interval to re-read the files.
# Labels assigned to all metrics scraped from the targets.
[ refresh_interval: <duration> | default = 30s ]
labels:
[ <labelname>: <labelvalue> ... ]
```
```
Where
`<
filename_pattern>`
may be a path ending in
`.json`
,
`.yml`
or
`.yaml`
. The last path segmen
t
Where
`<
host>`
is a valid string consisting of a hostname or IP followed by a por
t
may contain a single
`*`
that matches any character sequence, e.g.
`my/path/tg_*.json`
.
number
.
NOTE: Prior to v0.20,
`names:`
was used instead of
`files:`
.
### `<relabel_config>`
### `<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