You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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!
The text was updated successfully, but these errors were encountered:
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):
Is this something you'd look to support going forward?
Thanks!
The text was updated successfully, but these errors were encountered: