ripienaar/gdash — Issue #18: Global Config for Graphs
Author: nstielau
Created: 2011-12-06 20:15:18+00:00
State: open

I'm being lazy and opening an issue rather than submitting a pull request, but I didn't see a great way to do this first glance. There is certain graph config that I'd like to be available across graphs, i.e. colors or alias' or such. Since the .graph files are just evaluated ruby, it's easy to hack together something (I'm adding arbitrary config to the gdash.yml file, and loading in graphs), but it would be nice if this was supported out of the box.

Another thing I'd like to mention, is that Gdash does a great job of balancing load-time and view-time configuration. I rarely need to restart the Gdash processes, just drop new graphs and updates to gdash.yml!

Here's my global config hack:

config = YAML.load_file("/opt/gdash/config/gdash.yaml")
field "delete_requests", :data => "stats.api.requests.method.delete",
:color => config[:colors_by_method][:"delete"]