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
Shane, my bad
It looks I didn't understand correctly the following: relations_ of_type( rel_type)
"""
rels = hookenv.
"""
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 /pastebin. ubuntu. com/p/KPQvMfgbg c/
https:/
And the "host" label in the /metrics page is: +\.){3} [0-9]+' | xargs -I@ bash -xc 'curl -s @:9103/metrics | egrep -o "host=\"[^\"]+\"" | sort -u' 122:9103/ metrics ubuntu- 0" 200:9103/ metrics mysql-0"
"""
$ juju machines | egrep -o '([0-9]
+ curl -s 10.66.111.
+ egrep -o 'host="[^"]+"'
+ sort -u
host="tgraf:
+ curl -s 10.66.111.
+ egrep -o 'host="[^"]+"'
+ sort -u
host="tgraf:
"""
Note: "tgraf" is the model name