I have an infinity data source which queries an API healthcheck endpoint and it only returns status: OK
I have tried to create an alert that will trigger when status is not equal to OK
I keep getting an error when i try to create the alert [sse.readDataError] [A] got error: input data must be a wide series but got type not (input refid)
It looks like you're encountering a common issue when setting up alerts with the Infinity data source in Grafana. The error message indicates that the data returned by your query is not in the expected format for alerting, which requires a wide series format.
Here's how you can address this issue:
-
Ensure Data Format: Grafana alerting requires the data to be in a specific format. For tabular data, it should have only one numeric column. Since your data is returning a status, you might need to transform it into a numeric value that Grafana can evaluate.
-
Transform Status to Numeric: You can use a transformation to convert the status into a numeric value. For example, map "OK" to 0 and any other status to 1. This way, you can set up an alert condition to trigger when the value is greater than 0.
-
Use the Infinity Plugin's Features: The Infinity plugin supports various data manipulations. You can use UQL or JSONata to transform your data. For instance, if your data is JSON, you could use a transformation like:
jsonata
$map($, function($v) {
{
"status": $v.status = "OK" ? 0 : 1
}
})
-
Set Up the Alert Condition: Once your data is transformed, set up an alert condition in Grafana to trigger when the numeric value is greater than 0. This will effectively alert you when the status is not "OK".
-
Check Data Source Configuration: Ensure that your Infinity data source is correctly configured and that the query returns the expected data. You might need to adjust the query or the data source settings to ensure compatibility with Grafana's alerting requirements.
-
Review Alerting Documentation: Refer to the Grafana Alerting documentation for more details on setting up alerts and handling different data formats.
By following these steps, you should be able to create an alert that triggers when the status is not "OK". If you continue to experience issues, consider sharing more details about your query and data format for further assistance.
grot is still learning and improving, please let me know how I did by reacting below.
👍🏽 or 👎🏽