vimeo / graph-explorer

A graphite dashboard powered by structured metrics
http://vimeo.github.io/graph-explorer/
Apache License 2.0
1.06k stars 93 forks source link

Metric strings prefix configurable #55

Closed art-spilgames closed 10 years ago

art-spilgames commented 10 years ago

First of all: what an awesome app! I'm really amazed how quickly I managed to get it to work!

What I really miss (or haven't found yet) is how to prepend the metric strings if you don't follow the graph-explorer conventions. Within the structured_metrics/plugins directory I changed two of the plugins regular expressions to make it to work in our graphite environment as we chose to shard by environment and function.

For example I could have changed the collectd plugin from:

'match': '^collectd\.(?P<server>.+?)\.(?P<collectd_plugin>.+?)(?:-(?P<collectd_plugin_instance>.+?))?\.(?P<type>.+?)(?:-(?P<type_instance>.+?))?\.(?P<value>.+)$',

to:

'match': '^prd\.www\.collectd\.(?P<server>.+?)\.(?P<collectd_plugin>.+?)(?:-(?P<collectd_plugin_instance>.+?))?\.(?P<type>.+?)(?:-(?P<type_instance>.+?))?\.(?P<value>.+)$',

You can see we could have sharded here on environment prd (production) and function www. I can imagine others might also have similar cases where they have prepended their metric strings with their own prefix.

Dieterbe commented 10 years ago

ok, we don't really do this so i'm not to familiar with this, but i would gladly come up with a solution once i get a better idea of the requirements.

that prefix is that something coming from collectd, or from graphite? I assume with sharding you mean carbon sharding? when you use carbon sharding, does it prepend strings to all your metrics?

what do you think would be the best way to address this? just add a "metric_prefix" option to the config that will apply to all matches in all plugins?

maybe it's more productive if you could join #graph-explorer on freenode so we can talk about this

nikicat commented 10 years ago

+1