-
Notifications
You must be signed in to change notification settings - Fork 3
Open
Description
Hi,
I noticed that hisser doesn't appear to support queries like {serverA,serverB}.cpu.usage
This is particularly useful for selecting multiple values in Grafana drop-down lists.
I was able to get this "working" with the following patch, although I imagine there's a much better way to go about this (it also probably misses a lot of edge cases):
diff --git a/hisser/metrics.py b/hisser/metrics.py
index 6f947bb..20cefd5 100644
--- a/hisser/metrics.py
+++ b/hisser/metrics.py
@@ -200,6 +200,8 @@ class MetricIndex:
for idx, part in enumerate(query.split('.')):
if '*' in part or '[' in part:
queries.append(('.{}'.format(idx), '=~', '!' + part))
+ elif '{' in part:
+ queries.append(('.{}'.format(idx), '=~', ':' + part.strip('{}')))
else:
queries.append(('.{}'.format(idx), '=', part))
Is this something you'd look to support going forward?
Thanks!
Metadata
Metadata
Assignees
Labels
No labels