sgrover
sgrover

Reputation: 121

Graphite metric search using OR operator

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.

Upvotes: 3

Views: 2297

Answers (1)

walkeran
walkeran

Reputation: 139

You should be able to use the following syntax:

os.redhat.server1.*.{pct_size_used,pct_inodes_used}

or, IMHO, a bit cleaner:

os.redhat.server1.*.pct_{size,inodes}_used

Upvotes: 3

Related Questions