← Back to team overview

graphite-dev team mailing list archive

non standard storage backends

 

Hello,

I discussed this with Chris quite some time ago and he suggested that
I wait until the Ceres patch landed.  Since it has landed I'd like to
reopen the question.

What is the best way to link in a storage back end other than the
standard ones: Whisper, RRD and Ceres?

It looks like there is a nod to this in webapp/graphite/storage.py
starting at line 149:

149 # Exposed Storage API
150 finders = [
151   CeresFinder(settings.CERES_DIR),
152   StandardFinder(settings.STANDARD_DIRS),
153 ]
154 STORE = Store(finders, hosts=settings.CLUSTER_SERVERS)

How do I plugin my own finder? This seems like a place holder for a
storage API.   Obviously I can modify the code but then I have to
track my own patches to Graphite. Which I have done for some time now
and it's a bit tiring.

My suggestion would be to enumerate the finders in the settings file.
Something like this:

STORAGE_FINDERS = [('graphite.finders.CeresFinder', CERES_DIR),
('graphite.finders.StandardFinder', STANDARD_DIRS)]

And then creating an instance of each finder called with the second
item of the tuple as an argument in storage.py.  And passing that list
of finders to the Store.

(IIRC there were some circular import issues if you just try to create
a Store instance in settings.py so this sidesteps that.)

I'd be happy to create a patch that does something like this, but I
figured I'd get some input before I do it.

Does this seem like a reasonable approach?  Does someone else have
some other way of doing this already?

Thanks,

Jon


Follow ups