bosun
bosun copied to clipboard
Is there a way to parse group keys (tags) in Bosun to get a particular tag value?
I have a bosun server setup which queries OpenTSDB. We have some alerts setup which are grouped using certain tags.
Sample Query:
$query= sum:metrics.get{key1=*,key2=*}{outcome=ERROR}
Sample tags obtained are:
"Tags": "key1=value1,key2=value2"
This value is currently a string. I want to extract the value of a particular key from the Tags string. This would be something like treating this string as a map. Is there a way to do this in Bosun expression language?
What is the thing you are trying to achieve by extracting the value of the tag ?
Mark
I have a bosun server setup which queries OpenTSDB. We have some alerts setup which are grouped using certain tags.
Sample Query:
$query= sum:metrics.get{key1=*,key2=*}{outcome=ERROR}
Sample tags obtained are:
"Tags": "key1=value1,key2=value2"
This value is currently a string. I want to extract the value of a particular key from the Tags string. This would be something like treating this string as a map. Is there a way to do this in Bosun expression language?
Have you figured out a way ?
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.
I have a similar problem, I want to get the top 10 results after sort for the avg response time of the partner. I used the filter function to implement it, I want to leave it here just in case someone have the same problem.
filter(variantSet, numberSet) (seriesSet|numberSet) Returns all results in variantSet that are a subset of numberSet and have a non-zero value. Useful with the limit and sort functions to return the top X results of a query.
filter(q("avg:$sample-avg-zero:avg_overall_ms{partner=h_}", "$start", ""),limit(sort(avg(q("avg:$sample-avg-zero:avg_overall_ms{partner=h_}", "$start", "")),"desc"),10))
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.