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
db087cb7
Unverified
Commit
db087cb7
authored
Jan 25, 2017
by
Frederic Branczyk
Browse files
Options
Browse Files
Download
Plain Diff
Fix conflicts
parents
fedd8da6
fb9e2849
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
134 additions
and
2 deletions
+134
-2
configuration.md
content/docs/operating/configuration.md
+64
-2
api.md
content/docs/querying/api.md
+70
-0
No files found.
content/docs/operating/configuration.md
View file @
db087cb7
...
...
@@ -112,7 +112,7 @@ job_name: <name>
# How frequently to scrape targets from this job.
[ scrape_interval: <duration> | default = <global_config.scrape_interval> ]
# Per-
target
timeout when scraping this job.
# Per-
scrape
timeout when scraping this job.
[ scrape_timeout: <duration> | default = <global_config.scrape_timeout> ]
# The HTTP resource path on which to fetch metrics from targets.
...
...
@@ -205,6 +205,10 @@ nerve_sd_configs:
serverset_sd_configs:
[ - <serverset_sd_config> ... ]
# List of Triton service discovery configurations.
triton_sd_configs:
[ - <triton_sd_config> ... ]
# List of labeled statically configured targets for this job.
static_configs:
[ - <static_config> ... ]
...
...
@@ -216,6 +220,11 @@ relabel_configs:
# List of metric relabel configurations.
metric_relabel_configs:
[ - <relabel_config> ... ]
# Per-scrape limit on number of scraped samples that will be accepted.
# If more than this number of samples are present after metric relabelling
# the entire scrape will be treated as failed. 0 means no limit.
[ sample_limit: <int> | default = 0 ]
```
Where
`<scheme>`
may be
`http`
or
`https`
and
`<path>`
is a valid URL path.
...
...
@@ -716,6 +725,48 @@ paths:
Serverset data must be in the JSON format, the Thrift format is not currently supported.
### `<triton_sd_config>`
CAUTION: Triton SD is in beta: breaking changes to configuration are still
likely in future releases.
[
Triton
](
https://github.com/joyent/triton
)
SD configurations allow retrieving
scrape targets from
[
Container Monitor
](
https://github.com/joyent/rfd/blob/master/rfd/0027/README.md
)
discovery endpoints.
The following meta labels are available on targets during relabeling:
*
`__meta_triton_machine_id`
: the UUID of the target container
*
`__meta_triton_machine_alias`
: the alias of the target container
*
`__meta_triton_machine_image`
: the target containers image type
*
`__meta_triton_machine_server_id`
: the server UUID for the target container
```
# The information to access the Triton discovery API.
# The account to use for discovering new target containers.
account: <string>
# The DNS suffix which should be applied to target containers.
dns_suffix: <string>
# The Triton discovery endpoint (e.g. 'cmon.us-east-3b.triton.zone'). This is
# often the same value as dns_suffix.
endpoint: <string>
# The port to use for discovery and metric scraping.
[ port: <int> | default = 9163 ]
# The interval which should should be used for refreshing target containers.
[ refresh_interval: <duration> | default = 60s ]
# The Triton discovery API version.
[ version: <int> | default = 1 ]
# TLS configuration.
tls_config:
[ <tls_config> ]
```
### `<static_config>`
A
`static_config`
allows specifying a list of targets and a common label set
...
...
@@ -790,7 +841,7 @@ prefix is guaranteed to never be used by Prometheus itself.
`<regex>`
is any valid
[
RE2 regular expression
](
https://github.com/google/re2/wiki/Syntax
)
. It is
required for the
`replace`
,
`keep`
,
`drop`
and
`labelma
p`
actions. The regex is
required for the
`replace`
,
`keep`
,
`drop`
,
`labelmap`
,
`labeldrop`
and
`labelkee
p`
actions. The regex is
anchored on both ends. To un-anchor the regex, use
`.*<regex>.*`
.
`<relabel_action>`
determines the relabeling action to take:
...
...
@@ -805,6 +856,13 @@ anchored on both ends. To un-anchor the regex, use `.*<regex>.*`.
*
`labelmap`
: Match
`regex`
against all label names. Then copy the values of the matching labels
to label names given by
`replacement`
with match group references
(
`${1}`
,
`${2}`
, ...) in
`replacement`
substituted by their value.
*
`labeldrop`
: Match
`regex`
against all label names. Any label that matches will be
removed from the set of labels.
*
`labelkeep`
: Match
`regex`
against all label names. Any label that does not match will be
removed from the set of labels.
Care must be taken with
`labeldrop`
and
`labelkeep`
to ensure that metrics are still uniquely labeled
once the labels are removed.
### `<metric_relabel_configs>`
...
...
@@ -910,6 +968,10 @@ nerve_sd_configs:
serverset_sd_configs:
[ - <serverset_sd_config> ... ]
# List of Triton service discovery configurations.
triton_sd_configs:
[ - <triton_sd_config> ... ]
# List of labeled statically configured Alertmanagers.
static_configs:
[ - <static_config> ... ]
...
...
content/docs/querying/api.md
View file @
db087cb7
...
...
@@ -337,3 +337,73 @@ String results are returned as result type `string`. The corresponding
```
[ <unix_time>, "<string_value>" ]
```
## Targets
> This API is experimental as it is intended to be extended with targets
> dropped due to relabelling in the future.
The following endpoint returns an overview of the current state of the
Prometheus target discovery:
```
GET /api/v1/targets
```
Currently only the active targets are part of the response.
```
$ curl http://localhost:9090/api/v1/targets
{
"status": "success", [3/11]
"data": {
"activeTargets": [
{
"discoveredLabels": {
"__address__": "127.0.0.1:9090",
"__metrics_path__": "/metrics",
"__scheme__": "http",
"job": "prometheus"
},
"labels": {
"instance": "127.0.0.1:9090",
"job": "prometheus"
},
"scrapeUrl": "http://127.0.0.1:9090/metrics",
"lastError": "",
"lastScrape": "2017-01-17T15:07:44.723715405+01:00",
"health": "up"
}
]
}
}
```
## Alertmanagers
> This API is experimental as it is intended to be extended with Alertmanagers
> dropped due to relabelling in the future.
The following endpoint returns an overview of the current state of the
Prometheus alertmanager discovery:
```
GET /api/v1/alertmanagers
```
Currently only the active Alertmanagers are part of the response.
```
$ curl http://localhost:9090/api/v1/alertmanagers
{
"status": "success",
"data": {
"activeAlertmanagers": [
{
"url": "http://127.0.0.1:9090/api/v1/alerts"
}
]
}
}
```
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