Graphite metric search using the OR operation

Asked by Sumeet Grover

I am trying to fetch a list of metrics via the Render URL API in Graphite, such that only one of the matches are returned. For example, the following, hypothetical scenario:

os.redhat.server1.disk1.pct_size_used

os.redhat.server1.disk1.pct_inodes_used

So I want to fetch the following for all the disks such that if they are not recording "pct_size_used", the API should return their "pct_inodes_used" metric instead, but in cases where both metrics are recorded, API should only return the "pct_size_used":

os.redhat.server1.*.(pct_size_used|pct_inodes_used)

Any ideas how to do this? I know Graphite uses the Glob function internally to search for metrics, and Glob function does not support any such operation.

Question information

Language:
English Edit question
Status:
Solved
For:
Graphite Edit question
Assignee:
No assignee Edit question
Solved by:
Sumeet Grover
Solved:
Last query:
Last reply:
Revision history for this message
Wawrzyniec Niewodniczański (wawrzek) said :
#1

Maybe:

os.redhat.server1.*.pct_*_used

Revision history for this message
Sumeet Grover (sgrover) said :
#2

Thanks for your comment, but this does not solve the problem. As I mentioned previously, in cases where we have:
os.redhat.server1.disk1.pct_size_used
os.redhat.server1.disk1.pct_inodes_used

I would like the Glob regexp to only fetch "pct_size_used" metric. After having search thoroughly through the internet, it looks like there isn't any such feature in Graphite for this, therefore, whoever needs to use such a functionality will need to implement it themselves.

Revision history for this message
Sumeet Grover (sgrover) said :
#3

To conclude, this functionality is currently not in Graphite, therefore an in-house solution would need to be implemented.