Non-web API for accessing Whisper and Carbon

Asked by Xavier

Hello,

My team is working on a Python project in which we need to read values fed into Carbon by Shinken. I'm aware that one of my options is to install graphite-web and call the render web service, but I would prefer to read the values without having to call a web service. The reasons for this are that first, the graphite-web package installs a few dependencies like Django that we do not need, and second, because it makes more sense to me to directly call a python library from a python project without having to use a web stack.

So my first question is: are there any plans for doing an independant (non web) library for reading Whisper/Carbon values ? Did I miss an option for doing so ?

If there is no option and no plan, we may do our own library based on the graphite-web code base. If we end up doing this, we would be willing to contribute to the Graphite project with it, it you think you could make use of it. So let me know if that's the case !

Thanks

Question information

Language:
English Edit question
Status:
Answered
For:
Graphite Edit question
Assignee:
No assignee Edit question
Last query:
Last reply:
Revision history for this message
Dave Rawks (drawks) said :
#1

Bruno Renié has done the hard work reimplementing the render api without the web frontend.

https://github.com/brutasse/graphite-api

Revision history for this message
Dieter P (dieter-plaetinck) said :
#2

graphite-api is still a http api.
Xavier seems to be asking non-web (which i assume means non-http)
the answer to that is, that whisper *is* a python library for accessing whisper files. However it can only do basic read/write/update operations.
having the graphite api available as a python library so that you can query for "sumseries(foo.*)" in a python lib and get the appropriate response back, would be great. there's utilities like whisper-fetch and whisper-dump, but nothing that implements the render api, yet.

Revision history for this message
Xavier (xrm) said :
#3

Thanks for these answers. Long story short we have a statistical analysis tool written in Python that we need to run with Shinken data as an input. This library doesn't use a web frontend so as I said I don't want to have to call an HTTP service just for the sake of it, even if the API has nice querying and aggregation tools.

Another advantage of using the graphite API compared to the whisper library directly would be that graphite checks for values into Carbon's cache, but I'm not sure that's really relevant... I don't think the Carbon cache holds values for a very long time ? Am I right by saying that the cache is empty most of the time, except when Carbon's write limits are reached ?

Anyway we'll check if the whisper library is good enough for our need and let you know if we end up doing a separated library with the render API.

Thanks

Revision history for this message
Dieter P (dieter-plaetinck) said :
#4

how much datapoints are in cache and not on disk, this depends on your carbon config and your load.
using the render api via a python library would be really cool, esp. if it comes with a commandline program so that you could do
"graphite-render 'sum(foo.*)'" etc.

Can you help with this problem?

Provide an answer of your own, or ask Xavier for more information if necessary.

To post a message you must log in.