Hello all,
I have a Management server that controls various appliances. It collects metrics both from itself, and it also receives proxied influxdb format metrics remotely from the appliance. All of them output to a remote graphite. It looks like this:
[agent]
hostname = "${MANAGEMENT_ID}"
omit_hostname = false
[[outputs.graphite]]
## TCP endpoint for your graphite instance.
## If multiple endpoints are configured, the output will be load balanced.
## Only one of the endpoints will be written to with each iteration.
servers = ["${GRAPHITE_URL}"]
## Prefix metrics name
prefix = "application"
## Graphite output template
## see https://github.com/influxdata/telegraf/blob/master/docs/DATA_FORMATS_OUTPUT.md
template = "host.tags.measurement.field"
## timeout in seconds for the write connection to graphite
timeout = 2
[[inputs.influxdb_listener]]
service_address = ":8186"
##....
## VARIOUS OTHER INPUTS
The metrics coming from the influxdb_listener have a different host tag from the MANAGEMENT_ID set in agent. For those metrics output to graphite, I want to have a nested hierarchy, that would look like this:
Metric originating from Management with id mgmt_number1:
application.mgmt_number1.cpu0.cpu.usage
Metric originating from appliance with id *appliance_no1":
application.mgmt_number1.appliances.appliance_no1.cpu0.cpu.usage
My question is whether it is possible to edit the host tag in such a way? By default, what I get on the Graphite is appliance metrics that look like this:
application.appliance_no1.cpu0.cpu.usage
I did various manipulations, with tagexclude (resulting in the host part of the metric being dropped altogether) and name_prefix (which added my desired prefix way later inside the metric, ahead of the measurement name).
Is there something that would allow to morph a new host value out of the two?