So basically I have a dashboard that shows failure percentages on my dashboard for every event (events are in the column), and the rows are entities, and this was the data from the API call done with the help of the Infinity plugin. Here I want to add the alerting for this dashboard if the percentage is above a certain limit; email me regarding the alert. Now the actual problem here is I checked this online, but I was suggested using time series or converting the data to time series using the timestamp column. I do not have the timestamp column in my table; my data is not exactly a time series. How do I solve this problem?
Hi,
Can you share the query and transformations you’ve done? With data like:
{
"data": [
{
"value": 10,
"tag1": "tag"
},
{
"value": 20,
"tag1": "tag1"
}
]
}
(and parsing mode backend with data written into it) I get two “series” that will alert:
As far as I’m aware the should be no problem with lack of the timestamp - Grafana alerting operates on numbers (even time series have to be Reduced)
For your reference these are the transformations done on my dashboard but I am not getting where to add those transformations while creating new alert rule. Can you assist me in adding these transformations while creating new alert rule
"transformations": [
{
"id": "calculateField",
"options": {
"alias": "total",
"binary": {
"left": "countSuccessful",
"reducer": "sum",
"right": "countServerError"
},
"mode": "binary",
"reduce": {
"reducer": "sum"
}
}
},
{
"id": "calculateField",
"options": {
"alias": "failure",
"binary": {
"left": "countServerError",
"operator": "/",
"reducer": "sum",
"right": "total"
},
"mode": "binary",
"reduce": {
"reducer": "sum"
}
}
},
{
"id": "calculateField",
"options": {
"alias": "failurePercentage",
"binary": {
"left": "100",
"operator": "*",
"reducer": "sum",
"right": "failure"
},
"mode": "binary",
"reduce": {
"reducer": "sum"
}
}
},
{
"id": "groupingToMatrix",
"options": {
"columnField": "eventName",
"emptyValue": "empty",
"rowField": "entityId",
"valueField": "failurePercentage"
}
},
{
"id": "renameByRegex",
"options": {
"regex": "FIP:AA:(.*)",
"renamePattern": "$1"
}
},
{
"id": "renameByRegex",
"options": {
"regex": "AA:FIP:(.*)",
"renamePattern": "$1"
}
},
},```
do you have solution for it ?
You can’t use transformations in alerts - probably that’s why your alert failed. Which datasource are you using? Infinity? If so, can you provide a sample data and sample result?
Basically, I am doing a few calculations in the transformation section on my data, which I am getting from an API call, and then after all those calculations and transformations, I am showing the data on the dashboard. The transformations are being calculated as fields and grouped into a matrix. I just want to add the alerts on the table that is being formed after these transformations. Can you tell me how to do this from the information I have provided? If not, then tell me; I will add sample data and the data called from the API and the converted data after all those transformations.
So my baseline question is how do I write the expression for transformation grouping to a matrix so that I can do the transformation in computed columns, filter, and group by field of the query section instead of the transformations section?
I mean it could be possible but lots of that depend on the datasource and your data. As you know, you cannot use transformations in alerting. If you’re using Infinity Plugin, you can use backend parser and use Jsonata to transform the data in some way. If you don’t want to share the input data and output example, that’s all I can do. If you share the data, someone (maybe even me
) csn help you write the jsonata expression
let me share the data
This is the data being called from api :
And this is what looks after transformation :
Now can you help ?
can you help ?
so what do you want to alert? There seems to lots of metrics in your table. Can you paste the JSON along with screenshot. Just screenshot won’t give much context for anyone to help.
Basically, I have the failure percentages in my table (which was transformed from the original one). Please refer to the earlier comment for the original table and the transformed table. I want to put the alert on the transformed table mentioned in the above reply of mine…
My final requirement was getting the expression for the transformation Grouping to matrix so that i can do the transformation in query section.
The question still stands - can you share the original data (not a screen of the table but rather response from API in JSON copyable format - if it’s JSON or is it not)? Also what is it that you want to alert on? In Grafana you can alert on a single value per series - from the pasted screens it’s not clear. As much as I can tell you want to take the sum of errors (countClientError + countNotFoundError + countServerError etc.) and divide it by the sum of whole row? What does row represent in that case?


