I am using Influxdb and Grafana where i am creating alerts using flux query . below is sample data on which we are writing queries and getting details.
{
“measurement”: “005677201f8a”,
“time”: “datetime.utcnow()”,
“tags”: {
“MISN_ID”: “misn_at_20”
},
“fields”: {
“CPU_UTIL”: 61,
“CPU_RAM”: 27.8 so on
}
}
If we add fields like misn id, time, date then only we are getting them in labels(preview alerts/message for alerts), problem is if we add time in Tags, alerts starts checking and generating alert for every 1 second rather than going with conditions.
How do I get time and date in my alert message? Please suggest @scott@Anaisdg
Ok, it looks like you’re generating the alert using Grafana’s alerting system. I wish I knew more about templating Grafana alerts, but I do not. You may try looking on the Grafana community forum.
If you were sending the alert with raw Flux, that’s something I could help out with.
Not an expert, but consider:
1 remove the aggregatewindow line in your flux query since you appear to be looking for “last”
2 remove the group by time interval - This should leave time in your result.
3 your B clause can be eliminated since your flux query will return “last” grouped by all TAGS.
If you have extraneous tags consider un-grouping in flux with: |> group()
Not sure what you’re trying to accomplish with your expression $B==1 I would think you want $B > threshold value or < some threshold.
…some of these new tools are definitely worth experimenting with. Good luck