Add retracer health check metrics script
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
Daisy |
Fix Released
|
Medium
|
Brian Murray |
Bug Description
When we did the initial deploy I added a little script to all the retracers that we call from telegraf to get health metrics for the various retracer processes, it'd be great to get that rolled into either the retracer code itself or the charm. The script is super simple, it's just this:
#!/bin/bash
arch=$1
ps aux | grep -v grep | grep -q retracer-${arch}
if [ $? = 0 ]; then
echo check=retracer,
else
echo check=retracer,
fi
It expects to be called with an arch, ala retracer_check.sh amd64. I've also added an telegraf config which it would be nice to have the charm drop in place when it gets a telegraf relation, right now this is /etc/telegraf/
[[inputs.exec]]
commands = [
"/home/
"/home/
"/home/
"/home/
]
timeout = "5s"
data_format = "influx"
Obviously the paths to the scripts would change to reflect wherever that script ends up in the codebase.
tags: | added: canonical-is |
tags: | added: id-5bd74d034d44ca24e6ca5510 |
Changed in daisy: | |
status: | New → In Progress |
assignee: | nobody → Brian Murray (brian-murray) |
importance: | Undecided → Medium |
I've added the following hook to the daisy retracer charm:
$ ls -lh hooks/juju- info-relation- joined info-relation- joined impulse: ~/source- trees/daisy- plucker- charms/ xenial/ daisy-retracer ] info-relation- joined
-rwxrwxr-x 1 bdmurray bdmurray 369 Nov 8 14:08 hooks/juju-
[ 3:33PM 10881 ] [ bdmurray@
$ cat hooks/juju-
#!/bin/bash
. $(dirname $0)/common
CONF=/etc/ telegraf/ telegraf. d/retracer. conf LOCATION} /tools/ retracer_ check.sh $arch\",\n" >> $CONF
echo "[[inputs.exec]]\n" > $CONF
echo " commands = [\n" >> $CONF
for arch in ${ARCHITECTURES}; do
echo "\"${CODE_
done
echo " ]\n" >> $CONF
echo " timeout = \"5s\"\n" >> $CONF
echo " data_format = \"influx\"\n" >> $CONF
However it is never run on the unit despite the juju-info relationship being joined.
ubuntu@ juju-3a2dd5- stg-error- tracker- 9:~$ sudo grep juju-info /var/log/ juju/unit- retracer- app-0.log uniter. relation relations.go:495 joining relation "telegraf- retracer- app:juju- info retracer- app:juju- info" uniter. relation relations.go:531 joined relation "telegraf- retracer- app:juju- info retracer- app:juju- info"
2018-11-14 18:23:44 INFO juju.worker.
2018-11-14 18:23:45 INFO juju.worker.
...
Do you have any ideas about how I can get the telegraf configuration file setup the way you'd like?