0

I've tried a variety of approaches to filtering data, but none have worked. All attempts to get an alert for a given field (alert_rule_uid) were unsuccessful. Sample data:

"startsAt": "2023-05-26T04:04:00.000+03:00",
"status": {
  "inhibitedBy": [],
  "silencedBy": [],
  "state": "active"
},
"updatedAt": "2024-10-21T17:12:40.692+03:00",
"generatorURL": "https://someurl/view",
"labels": {
  "__alert_rule_uid__": "yfluEK1217k",
  "alertname": "DatasourceError",
  "grafana_folder": "DevOps",
  "rule_uid": "yfluEK17k",
  "rulename": "CPU usage % u-c2 alert"
}
}
{
"annotations": {
  "__alertId__": "10007",
  "__dashboardUid__": "Enr22aSuGk",
  "__orgId__": "1",
  "__panelId__": "150"
},
"endsAt": "2024-10-21T17:14:00.000+03:00",
"fingerprint": "f796f60b324752bc0",
"receivers": [
  {
    "active": null,
    "integrations": null,
    "name": "grafana-default-email"
  }
],
"startsAt": "2024-09-11T07:24:00.000+03:00",
"status": {
  "inhibitedBy": [],
  "silencedBy": [],
  "state": "active"
},
"updatedAt": "2024-10-21T17:12:06.054+03:00",
"generatorURL": "https://someurl/view",
"labels": {
  "__alert_rule_uid__": "FEj22XEKJ7k",
  "alertname": "DatasourceError",
  "datasource_uid": "ZOJqa222IGz",
  "grafana_folder": "somefolder",
  "ref_id": "F",
  "rule_uid": "FEjXEKJ7k",
  "rulename": "POD not running alert"
}
}
{
"annotations": {
  "__alertId__": "327",
  "__dashboardUid__": "mkD9f2wMz",
  "__orgId__": "1",
  "__panelId__": "6",
  "description": "Load Average 15m 1 more than \"1\""
},
"endsAt": "2024-10-21T17:16:00.000+03:00",
"fingerprint": "f9fa7a8b3c1219bedf",
"receivers": [
  {
    "active": null,
    "integrations": null,
    "name": "grafana-default-email"
  }
],

A few examples of how I requested data:

curl -X 'GET' \
  'http://raw.githubusercontent.com/api/alertmanager/grafana/api/v2/alerts?active=true&silenced=true&inhibited=true&filter=yfluEK1217k' \
  -H 'accept: application/json'

curl -X 'GET' \
'localhost:3000/api/alertmanager/grafana/api/v2/alerts?active=true&silenced=true&inhibited=true&filter=rule_uid%5BtD_XPKJnk%5D'\
  -H 'accept: application/json'

curl 'localhost:3000/api/alertmanager/grafana/api/v2/alerts?active=true&silenced=true&inhibited=true&filter=fingerprint=01ca1c11539cde25' \
 -X GET \
 -H "Accept: application/json"\

It can be reproduced as follows:

  1. Add alert rules
  2. Write a request to receive alerts with filter
  3. Try to execute it and get an alert for a unique value

Grafana v10.4.3

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.