2019-11-27 07:46:31 +08:00
|
|
|
# Prometheus Output Plugin
|
2015-10-23 00:17:57 +08:00
|
|
|
|
2022-04-21 23:45:47 +08: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-23 00:17:57 +08:00
|
|
|
|
2022-10-27 03:58:36 +08:00
|
|
|
## Global configuration options <!-- @/docs/includes/plugin_config.md -->
|
|
|
|
|
|
|
|
|
|
In addition to the plugin-specific configuration settings, plugins support
|
|
|
|
|
additional global and plugin configuration settings. These settings are used to
|
|
|
|
|
modify metrics, tags, and field or create aliases and configure ordering, etc.
|
|
|
|
|
See the [CONFIGURATION.md][CONFIGURATION.md] for more details.
|
|
|
|
|
|
2023-01-12 23:55:21 +08:00
|
|
|
[CONFIGURATION.md]: ../../../docs/CONFIGURATION.md#plugins
|
2022-10-27 03:58:36 +08:00
|
|
|
|
2021-11-25 02:47:33 +08:00
|
|
|
## Configuration
|
2017-06-20 02:04:08 +08:00
|
|
|
|
2022-05-25 22:48:59 +08:00
|
|
|
```toml @sample.conf
|
2022-04-08 05:55:03 +08:00
|
|
|
# Configuration for the Prometheus client to spawn
|
2017-06-20 02:04:08 +08:00
|
|
|
[[outputs.prometheus_client]]
|
2018-08-25 07:37:11 +08:00
|
|
|
## Address to listen on.
|
2017-06-30 05:03:42 +08:00
|
|
|
listen = ":9273"
|
2017-06-20 02:04:08 +08:00
|
|
|
|
2023-04-03 21:23:05 +08:00
|
|
|
## Maximum duration before timing out read of the request
|
|
|
|
|
# read_timeout = "10s"
|
|
|
|
|
## Maximum duration before timing out write of the response
|
|
|
|
|
# write_timeout = "10s"
|
|
|
|
|
|
2022-05-27 00:07:44 +08:00
|
|
|
## Metric version controls the mapping from Prometheus metrics into Telegraf metrics.
|
|
|
|
|
## See "Metric Format Configuration" in plugins/inputs/prometheus/README.md for details.
|
|
|
|
|
## Valid options: 1, 2
|
2019-11-27 07:46:31 +08:00
|
|
|
# metric_version = 1
|
|
|
|
|
|
2018-08-25 07:37:11 +08:00
|
|
|
## Use HTTP Basic Authentication.
|
|
|
|
|
# basic_username = "Foo"
|
|
|
|
|
# basic_password = "Bar"
|
|
|
|
|
|
|
|
|
|
## If set, the IP Ranges which are allowed to access metrics.
|
|
|
|
|
## ex: ip_range = ["192.168.0.0/24", "192.168.1.0/30"]
|
|
|
|
|
# ip_range = []
|
2018-02-02 03:12:16 +08:00
|
|
|
|
2018-08-25 07:37:11 +08:00
|
|
|
## Path to publish the metrics on.
|
|
|
|
|
# path = "/metrics"
|
2018-02-02 03:12:16 +08:00
|
|
|
|
2018-08-25 07:37:11 +08:00
|
|
|
## Expiration interval for each metric. 0 == no expiration
|
|
|
|
|
# expiration_interval = "60s"
|
2018-08-02 06:43:34 +08:00
|
|
|
|
2018-08-25 07:37:11 +08:00
|
|
|
## Collectors to enable, valid entries are "gocollector" and "process".
|
|
|
|
|
## If unset, both are enabled.
|
|
|
|
|
# collectors_exclude = ["gocollector", "process"]
|
2017-09-20 02:27:11 +08:00
|
|
|
|
2018-08-25 07:37:11 +08:00
|
|
|
## Send string metrics as Prometheus labels.
|
|
|
|
|
## Unless set to false all string metrics will be sent as labels.
|
|
|
|
|
# string_as_label = true
|
2018-02-17 06:07:26 +08:00
|
|
|
|
2018-08-25 07:37:11 +08:00
|
|
|
## If set, enable TLS with the given certificate.
|
|
|
|
|
# tls_cert = "/etc/ssl/telegraf.crt"
|
|
|
|
|
# tls_key = "/etc/ssl/telegraf.key"
|
2019-08-20 08:42:00 +08:00
|
|
|
|
2019-02-27 02:46:49 +08:00
|
|
|
## Set one or more allowed client CA certificate file names to
|
|
|
|
|
## enable mutually authenticated TLS connections
|
|
|
|
|
# tls_allowed_cacerts = ["/etc/telegraf/clientca.pem"]
|
2019-01-18 02:51:18 +08:00
|
|
|
|
|
|
|
|
## Export metric collection time.
|
|
|
|
|
# export_timestamp = false
|
2023-09-11 21:45:16 +08:00
|
|
|
|
|
|
|
|
## Specify the metric type explicitly.
|
|
|
|
|
## This overrides the metric-type of the Telegraf metric. Globbing is allowed.
|
|
|
|
|
# [outputs.prometheus_client.prometheus_metric_types]
|
|
|
|
|
# counter = []
|
|
|
|
|
# gauge = []
|
2017-06-20 02:04:08 +08:00
|
|
|
```
|
2020-06-19 02:03:11 +08:00
|
|
|
|
2021-11-25 02:47:33 +08:00
|
|
|
## Metrics
|
2020-06-19 02:03:11 +08:00
|
|
|
|
2022-04-21 23:45:47 +08:00
|
|
|
Prometheus metrics are produced in the same manner as the [prometheus
|
|
|
|
|
serializer][].
|
2020-06-19 02:03:11 +08:00
|
|
|
|
|
|
|
|
[prometheus serializer]: /plugins/serializers/prometheus/README.md#Metrics
|