Telegraf is an agent written in Go for collecting metrics from the system it's running on, or from other services, and writing them into InfluxDB or other outputs.
Design goals are to have a minimal memory footprint with a plugin system so that developers in the community can easily add support for collecting metrics from well known services (like Hadoop, Postgres, or Redis) and third party APIs (like Mailchimp, AWS CloudWatch, or Google Analytics).
New input and output plugins are designed to be easy to contribute, we'll eagerly accept pull requests and will manage the set of plugins that Telegraf supports. See the contributing guide for instructions on writing new plugins.
This is a subordinate charm to deploy telegraf metrics agent to collect metrics from all services deployed in the environment.
For details about telegraf see: https://github.com/influxdata/telegraf
Deploy telegraf alonside your service, and also a time series storage (in this case, influxdb)
juju deploy telegraf
juju deploy influxdb
juju deploy some-service
Add the relations:
juju add-relation telegraf:juju-info some-service:juju-info
juju add-relation telegraf:influxdb-api influxdb:api
By default there is no output plugin configured, but a basic set of input plugins are setup, which can be overriden with inputs_config charm config.
The only output plugin supported via relation is influxdb, any other output plugin needs to be configured manually (via juju set)
To configure any of the (default or via relation) plugins, the extra_options charm config can be used. It's string in yaml format, for example:
ignore_fs: ["tmpfs", "devtmpfs"]
databases: ["foo", "bar"]
db: ["template", "postgres"]
This extra options will only be applied to plugins defined in templates/base_inputs.conf and any other plugins configured via relations.
To use a different metrics storage, e.g: graphite. the plugin configuration needs to be set as a base64 string in outputs_config configuration.
For exmaple, save the following config to a file:
servers = ["10.0.3.231:2003"]
prefix = "juju_local.devel.telegraf"
timeout = 10
juju set telegraf outputs_config="$(cat graphite-output.conf | base64)"
This will make telegraf agents to send the metrics to the graphite instance.