I have Grafana metrics (Graphite as backend) with metrics named like this:
stats.counters.appserver.det.timeout.5287534957488140100.count
I'd like to replace the guid (5287534957488140100) with a more human readable string but at the time of sending the metrics to statsd (which in turn sends data to graphite) I don't have that available.
Is it possible to do this replacement afterwards? I have the human readable string connected to the guid in a separate database but I can send that to statsd/graphite/grafana in intervals / whenever a new one is added if I know how.
It seems like the graphite function aliasByNode
could be used for this but how would I get the data I want to replace with into graphite dynamically?
You can rewrite every metric in the carbon-relay. If you use:
carbon-relay - http://graphite.readthedocs.io/en/latest/config-carbon.html#rewrite-rules-conf
stats.counters.appserver.det.timeout.5287534957488140100 = stats.counters.appserver.det.timeout.my-human-friendly-name
carbon-c-relay - https://github.com/grobian/carbon-c-relay#rewrites
rewrite ^stats.counters.appserver.det.timeout.5287534957488140100 into stats.counters.appserver.det.timeout.my-human-friendly-name
some other relay ...
Note that you could match and replace only the 5287534957488140100
, but keep in mind (especially with carbon-relay) it can be expensive.
A different approach would be to leave this metric as is and additionally create an alias - Can Graphite (whisper) metrics be aliased?.