Merge ~stub/charm-telegraf:tweaks into ~telegraf-charmers/charm-telegraf:master

Proposed by Stuart Bishop
Status: Merged
Approved by: Stuart Bishop
Approved revision: 46d236e9845841c7cb76eca0b65549b51d86a685
Merged at revision: 0bd067f683aad709e417a7d3cd12f9c32826bd53
Proposed branch: ~stub/charm-telegraf:tweaks
Merge into: ~telegraf-charmers/charm-telegraf:master
Prerequisite: ~stub/charm-telegraf:prometheus-by-default
Diff against target: 184 lines (+95/-46)
2 files modified
Makefile (+4/-2)
README.md (+91/-44)
Reviewer Review Type Date Requested Status
Guillermo Gonzalez Approve
Stuart Bishop (community) Approve
Review via email: mp+302770@code.launchpad.net

This proposal supersedes a proposal from 2016-08-09.

Description of the change

Polish the README and tweak the makefile a bit.

Dependent on prometheus-by-default, as that is what this version of the docs says. Its a minor change if that isn't going to land.

To post a comment you must log in.
Revision history for this message
Guillermo Gonzalez (verterok) wrote : Posted in a previous version of this proposal

+1

please see inline comment.

review: Approve
Revision history for this message
Stuart Bishop (stub) wrote : Posted in a previous version of this proposal

The merge was fine but running tests failed.

review: Needs Fixing
Revision history for this message
Stuart Bishop (stub) wrote :

Previously approved

review: Approve
Revision history for this message
Guillermo Gonzalez (verterok) :
review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
diff --git a/Makefile b/Makefile
index 1ee0243..8fd218f 100644
--- a/Makefile
+++ b/Makefile
@@ -21,11 +21,13 @@ venv:
21test: venv 21test: venv
22 venv/bin/py.test unit_tests/ -v22 venv/bin/py.test unit_tests/ -v
2323
24build: clean24build: realclean
25 @if test -z ${JUJU_REPOSITORY} || test -z ${INTERFACE_PATH} || test -z ${LAYER_PATH}; then echo "JUJU_REPOSITORY, LAYER_PATH and INTERFACE_PATH needs to be defined"; exit 1; fi
26 @charm build25 @charm build
2726
28clean: 27clean:
29 @find -name __pycache__ | xargs rm -rf28 @find -name __pycache__ | xargs rm -rf
30 @find -name *.pyc | xargs rm -rf29 @find -name *.pyc | xargs rm -rf
31 @rm -Rf venv30 @rm -Rf venv
31
32realclean:
33 git clean -fxd
diff --git a/README.md b/README.md
index 619041c..567b3e4 100644
--- a/README.md
+++ b/README.md
@@ -1,6 +1,8 @@
1# Overview1# Overview
22
3This is a subordinate charm to deploy telegraf metrics agent to collect metrics from all services deployed in the environment.3This is a subordinate charm to deploy the telegraf metrics agent to collect
4metrics from related services. The metrics may be scraped by or pushed
5to supported systems such as Prometheus, Graphite or InfluxDB.
46
5For details about telegraf see: https://github.com/influxdata/telegraf 7For details about telegraf see: https://github.com/influxdata/telegraf
68
@@ -20,61 +22,106 @@ Add the relations:
2022
21# Configuration23# Configuration
2224
23By 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.25## Prometheus Output
2426
25To 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: 27By default, Prometheus output is presented available for scraping.
2628
27 inputs:29## InfluxDB Output
28 cpu:
29 percpu: false
30 fielddrop: ["time_*"]
31 disk:
32 mount_points: ["/"]
33 ignore_fs: ["tmpfs", "devtmpfs"]
34 elasticsearch:
35 local: false
36 cluster_health: true
37 postgresql:
38 databases: ["foo", "bar"]
39 tagpass:
40 db: ["template", "postgres"]
41 outputs:
42 influxdb:
43 precision: ms
4430
45This extra options will only be applied to plugins defined in templates/base_inputs.conf and any other plugins configured via relations.31When related to an InfluxDB service, metrics will be pushed to a database
32named ``telegraf``.
4633
47## Apache input34## Apache Input
4835
49For the apache input plugin, the charm provides the apache relation which uses apache-website interface. Current apache charm disables mod_status and in order to telegraf apache input to work 'status' should be removed from the list of disable_modules in the apache charm config.36For the apache input plugin, the charm provides the apache relation which
37uses ``apache-website`` interface. Current apache charm disables
38``mod_status`` and in order to telegraf apache input to work ``status``
39should be removed from the list of ``disable_modules`` in the apache charm
40config.
5041
51## Postgresql input 42## Postgresql input
5243
53Due to a [bug/regression](https://bugs.launchpad.net/postgresql-charm/+bug/1560262) in the new postgresql-charm in order to get actual postgresql metrics, two relations need to be established between telegraf and the postgresql service, first a plain juju-info relation to get telegraf setup and then a regular postgresql/db one. e.g:44Due to [relation scope issues](https://bugs.launchpad.net/postgresql-charm/+bug/1560262), two relations need to be established between telegraf and the
5445postgresql service. first a plain ``juju-info`` relation to get standard
55juju add-relation telegraf:juju-info postgresql:juju-info 46system metrics and a ``postgresql`` relation for PostgreSQL database metrics.
56juju add-relation telegraf:postgresql postgresql:db47eg.:
5748
58## Output 49 ```
5950 juju add-relation postgresql:juju-info telegraf
60The only output plugin supported via relation is influxdb, any other output plugin needs to be configured manually (via juju set)51 juju add-relation postgresql:db telegraf
6152 ```
62To use a different metrics storage, e.g: graphite. the plugin configuration needs to be set as a base64 string in outputs_config configuration.53
6354## Advanced
64For exmaple, save the following config to a file: 55
6556### Input
66 [[outputs.graphite]]57
67 servers = ["10.0.3.231:2003"]58A basic set of input plugins are setup by default, which can be overriden
68 prefix = "juju_local.devel.telegraf"59with the ``inputs_config`` configuration option. Both of these accept raw
69 timeout = 1060telegraf configuration.
7061
71And then 62To configure any of the (default or via relation) plugins, the
7263``extra_options`` charm config can be used. It's yaml, that needs to
73 juju set telegraf outputs_config="$(cat graphite-output.conf | base64)"64be encoded as a string in the config. For example:
65
66 ```yaml
67 telegraf:
68 # The trailing | means the following indented section is all one string.
69 extra_options: |
70 inputs:
71 cpu:
72 percpu: false
73 fielddrop: ["time_*"]
74 disk:
75 mount_points: ["/"]
76 ignore_fs: ["tmpfs", "devtmpfs"]
77 elasticsearch:
78 local: false
79 cluster_health: true
80 postgresql:
81 databases: ["foo", "bar"]
82 tagpass:
83 db: ["template", "postgres"]
84 outputs:
85 influxdb:
86 precision: ms
87 ```
88
89This extra options will only be applied to pligins configured via
90relations and the following list (defined in ``templates/base_inputs.conf``):
91 - inputs.cpu
92 - inputs.disk
93 - inputs.diskio
94 - inputs.mem
95 - inputs.net
96 - inputs.netstat
97 - inputs.swap
98 - inputs.system
99
100
101### Output
102
103The only output plugin supported via relation is influxdb, any other output
104plugin needs to be configured manually (via juju set).
105
106To use a different metrics storage such as Graphite, the raw telegraf
107plugin configuration needs to be set as a string in ``outputs_config``
108configuration. For example:
109
110 ```yaml
111 telegraf:
112 # The trailing | indicates a multiline string in yaml.
113 outputs_config: |
114 [[outputs.graphite]]
115 servers = ["10.0.3.231:2003"]
116 prefix = "juju_local.devel.telegraf"
117 timeout = 10
118 ```
74119
75This will make telegraf agents to send the metrics to the graphite instance.120This will make telegraf agents to send the metrics to the graphite instance.
76121
77# Contact Information122# Contact Information
78123
124- Prometheus Charming Project: https://launchpad.net/prometheus-charms
125- Charm bugs: https://bugs.launchpad.net/telegraf-charm
79- Upstream https://github.com/influxdata/telegraf126- Upstream https://github.com/influxdata/telegraf
80- Upstream bug tracker https://github.com/influxdata/telegraf/issues127- Upstream bug tracker https://github.com/influxdata/telegraf/issues

Subscribers

People subscribed via source and target branches

to all changes: