How to retrieve only entered (non-None) values?

Asked by Michael Alford on 2012-05-25

When performing a JSON query against the Graphite URL API, is there a way to request that only entered values are returned?

For metrics that are rarely reported but have a fine-grained time interval, the efficiency of sending only a few metric values over-the-wire is attractive over sending many mostly null values.

Example query: http://localhost/render?target=myMetricName&format=json

Question information

Language:
English Edit question
Status:
Answered
For:
Graphite Edit question
Assignee:
No assignee Edit question
Last query:
2012-05-25
Last reply:
2012-05-26
Michael Leinartas (mleinartas) said : #1

Sorry to disappoint but no, there's no way to only get non-null values returned. Since the json format outputs pairs rather than evenly-spaced values like the other formats it is possible for this to be implemented (something like sparseJson=True?). If you think it'd be worthwhile, feel free to submit a patch or open a bug as a feature request

Stuart Zakon (sjz18) said : #2

Please provide a hint on where to add this new format. It is worth it to do this patch rather than rewrite a version of graphite from scratch.

Can you help with this problem?

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

To post a message you must log in.