2015-10-22 16:17:57 +00:00
|
|
|
# Prometheus Client Service Output Plugin
|
|
|
|
|
2017-09-19 18:27:11 +00:00
|
|
|
This plugin starts a [Prometheus](https://prometheus.io/) Client, it exposes all metrics on `/metrics` (default) to be polled by a Prometheus server.
|
2015-10-22 16:17:57 +00:00
|
|
|
|
2017-06-19 18:04:08 +00:00
|
|
|
## Configuration
|
|
|
|
|
|
|
|
```
|
|
|
|
# Publish all metrics to /metrics for Prometheus to scrape
|
|
|
|
[[outputs.prometheus_client]]
|
|
|
|
# Address to listen on
|
2017-06-29 21:03:42 +00:00
|
|
|
listen = ":9273"
|
2017-06-19 18:04:08 +00:00
|
|
|
|
2018-02-01 19:12:16 +00:00
|
|
|
# Use TLS
|
|
|
|
tls_cert = "/etc/ssl/telegraf.crt"
|
|
|
|
tls_key = "/etc/ssl/telegraf.key"
|
|
|
|
|
|
|
|
# Use http basic authentication
|
|
|
|
basic_username = "Foo"
|
|
|
|
basic_password = "Bar"
|
|
|
|
|
2018-08-01 22:43:34 +00:00
|
|
|
# IP Ranges which are allowed to access metrics
|
|
|
|
ip_range = ["192.168.0.0/24", "192.168.1.0/30"]
|
|
|
|
|
2017-09-19 18:27:11 +00:00
|
|
|
# Path to publish the metrics on, defaults to /metrics
|
|
|
|
path = "/metrics"
|
|
|
|
|
2017-06-19 18:04:08 +00:00
|
|
|
# Expiration interval for each metric. 0 == no expiration
|
|
|
|
expiration_interval = "60s"
|
2018-02-16 22:07:26 +00:00
|
|
|
|
|
|
|
# Send string metrics as Prometheus labels.
|
|
|
|
# Unless set to false all string metrics will be sent as labels.
|
|
|
|
string_as_label = true
|
2017-06-19 18:04:08 +00:00
|
|
|
```
|