grafana / carbon-relay-ng

Fast carbon relay+aggregator with admin interfaces for making changes online - production ready
Other
467 stars 151 forks source link

Best way to implement metric renaming #102

Closed iksaif closed 7 years ago

iksaif commented 8 years ago

Currently carbon-relay-ng as two great features: routing and aggregation, and in my case I'd like to be able to rename metrics on the fly (kind of like a noop aggregation). What do you think would be the best way to implement that ?

Dieterbe commented 8 years ago

hm not sure TBH, i haven't looked at the code in a while. i'm thinking maybe as a pre-aggregation, pre-routing step, after the blacklist? i presume it's ok to only be able to rename incoming metrics, and not the output of aggregators

iksaif commented 8 years ago

What about adding it as an option of routing ? There is already a match regexp, we could add a 'replacement' that if specified would be used to rename the metric for this particular route.

Dieterbe commented 8 years ago

routes already have so many options, i don't think it's a good idea to add even more options especially if they aren't actually routing related.

iksaif commented 8 years ago

Then, a new 'Renaming' section, module, add associated addRename command. If that looks like the best solution I'll look into implementing the code.

Dieterbe commented 8 years ago

Hey @iksaif i just stumbled upon this issue. A while ago i implemented a rewriter functionality in #128 , does this work for you?