2020-03-06 02:36:36 +08:00
|
|
|
# Stackdriver Google Cloud Monitoring Output Plugin
|
2018-10-17 02:47:10 +08:00
|
|
|
|
2020-03-06 02:36:36 +08:00
|
|
|
This plugin writes to the [Google Cloud Monitoring API][stackdriver] (formerly
|
|
|
|
|
Stackdriver) and requires [authentication][] with Google Cloud using either a
|
|
|
|
|
service account or user credentials
|
|
|
|
|
|
|
|
|
|
This plugin accesses APIs which are [chargeable][pricing]; you might incur
|
|
|
|
|
costs.
|
2018-10-17 02:47:10 +08:00
|
|
|
|
|
|
|
|
Requires `project` to specify where Stackdriver metrics will be delivered to.
|
|
|
|
|
|
2022-04-21 23:45:47 +08:00
|
|
|
Metrics are grouped by the `namespace` variable and metric key - eg:
|
|
|
|
|
`custom.googleapis.com/telegraf/system/load5`
|
2018-10-17 02:47:10 +08:00
|
|
|
|
2022-04-21 23:45:47 +08:00
|
|
|
[Resource type](https://cloud.google.com/monitoring/api/resources) is configured
|
|
|
|
|
by the `resource_type` variable (default `global`).
|
2019-02-09 04:13:33 +08:00
|
|
|
|
2022-04-21 23:45:47 +08:00
|
|
|
Additional resource labels can be configured by `resource_labels`. By default
|
|
|
|
|
the required `project_id` label is always set to the `project` variable.
|
2019-02-09 04:13:33 +08:00
|
|
|
|
2021-11-25 02:47:33 +08:00
|
|
|
## Configuration
|
2018-10-17 02:47:10 +08:00
|
|
|
|
2018-10-17 03:23:05 +08:00
|
|
|
```toml
|
2022-04-08 05:55:03 +08:00
|
|
|
# Configuration for Google Cloud Stackdriver to send metrics to
|
2018-10-17 03:23:05 +08:00
|
|
|
[[outputs.stackdriver]]
|
2019-02-12 06:58:30 +08:00
|
|
|
## GCP Project
|
2018-10-17 02:47:10 +08:00
|
|
|
project = "erudite-bloom-151019"
|
|
|
|
|
|
2019-02-12 06:58:30 +08:00
|
|
|
## The namespace for the metric descriptor
|
2018-10-17 02:47:10 +08:00
|
|
|
namespace = "telegraf"
|
2019-02-09 04:13:33 +08:00
|
|
|
|
2019-02-12 06:58:30 +08:00
|
|
|
## Custom resource type
|
|
|
|
|
# resource_type = "generic_node"
|
2019-02-09 04:13:33 +08:00
|
|
|
|
2020-05-14 15:41:58 +08:00
|
|
|
## Additional resource labels
|
2019-02-12 06:58:30 +08:00
|
|
|
# [outputs.stackdriver.resource_labels]
|
|
|
|
|
# node_id = "$HOSTNAME"
|
|
|
|
|
# namespace = "myapp"
|
|
|
|
|
# location = "eu-north0"
|
2018-10-17 03:23:05 +08:00
|
|
|
```
|
2019-02-06 10:22:42 +08:00
|
|
|
|
2021-11-25 02:47:33 +08:00
|
|
|
## Restrictions
|
2019-02-06 10:22:42 +08:00
|
|
|
|
2022-04-21 23:45:47 +08:00
|
|
|
Stackdriver does not support string values in custom metrics, any string fields
|
|
|
|
|
will not be written.
|
2019-02-07 06:17:51 +08:00
|
|
|
|
2022-04-21 23:45:47 +08:00
|
|
|
The Stackdriver API does not allow writing points which are out of order, older
|
|
|
|
|
than 24 hours, or more with resolution greater than than one per point minute.
|
|
|
|
|
Since Telegraf writes the newest points first and moves backwards through the
|
|
|
|
|
metric buffer, it may not be possible to write historical data after an
|
|
|
|
|
interruption.
|
2019-02-07 06:17:51 +08:00
|
|
|
|
2022-04-21 23:45:47 +08:00
|
|
|
Points collected with greater than 1 minute precision may need to be aggregated
|
|
|
|
|
before then can be written. Consider using the [basicstats][] aggregator to do
|
|
|
|
|
this.
|
2019-02-07 06:17:51 +08:00
|
|
|
|
2022-04-21 23:45:47 +08:00
|
|
|
Histogram / distribution and delta metrics are not yet supported. These will be
|
|
|
|
|
dropped silently unless debugging is on.
|
2021-12-23 04:11:28 +08:00
|
|
|
|
|
|
|
|
Note that the plugin keeps an in-memory cache of the start times and last
|
2022-04-21 23:45:47 +08:00
|
|
|
observed values of all COUNTER metrics in order to comply with the requirements
|
|
|
|
|
of the stackdriver API. This cache is not GCed: if you remove a large number of
|
|
|
|
|
counters from the input side, you may wish to restart telegraf to clear it.
|
2021-12-23 04:11:28 +08:00
|
|
|
|
2019-02-07 06:17:51 +08:00
|
|
|
[basicstats]: /plugins/aggregators/basicstats/README.md
|
2022-04-21 23:45:47 +08:00
|
|
|
|
2020-03-06 02:36:36 +08:00
|
|
|
[stackdriver]: https://cloud.google.com/monitoring/api/v3/
|
2022-04-21 23:45:47 +08:00
|
|
|
|
2020-03-06 02:36:36 +08:00
|
|
|
[authentication]: https://cloud.google.com/docs/authentication/getting-started
|
2022-04-21 23:45:47 +08:00
|
|
|
|
2021-12-23 04:11:28 +08:00
|
|
|
[pricing]: https://cloud.google.com/stackdriver/pricing#google-clouds-operations-suite-pricing
|