Comment 1 for bug 1775062

Revision history for this message
Alvaro Uria (aluria) wrote :

Shane, my bad

It looks I didn't understand correctly the following:
"""
rels = hookenv.relations_of_type(rel_type)
"""

However, my quick test works as I expected:
"""
juju deploy ubuntu --to lxd:0
juju deploy mysql --to lxd:1
juju deploy telegraf

juju add-relation ubuntu telegraf:juju-info
juju add-relation mysql:db-admin telegraf:mysql
juju add-relation mysql:juju-info telegraf:juju-info
"""

"juju status --format yaml" shows
https://pastebin.ubuntu.com/p/KPQvMfgbgc/

And the "host" label in the /metrics page is:
"""
$ juju machines | egrep -o '([0-9]+\.){3}[0-9]+' | xargs -I@ bash -xc 'curl -s @:9103/metrics | egrep -o "host=\"[^\"]+\"" | sort -u'
+ curl -s 10.66.111.122:9103/metrics
+ egrep -o 'host="[^"]+"'
+ sort -u
host="tgraf:ubuntu-0"
+ curl -s 10.66.111.200:9103/metrics
+ egrep -o 'host="[^"]+"'
+ sort -u
host="tgraf:mysql-0"

"""
Note: "tgraf" is the model name