Does Kibana Alerting API also configure Elastic Stack Monitoring Alerts?

I have been using Kibana Alert API to create stack monitoring alerts for elastic search cluster, however, it doesn't work:

POST /api/alerts/alert
{
  "params":{
      "aggType":"avg",
      "termSize":6,
      "thresholdComparator":">",
      "timeWindowSize":5,
      "timeWindowUnit":"m",
      "groupBy":"top",
      "threshold":[
         85
      ],
      "timeField":"@timestamp",
      "aggField":"sheet.version",
      "termField":"name.keyword"
   },
   "consumer":"alerts",
   "alertTypeId":".cpu-usage",
   "schedule":{
      "interval":"1m"
   },
   "actions":[
      {
         "id":"dceeb5d0-6b41-11eb-802b-85b0c1bc8ba2",
         "actionTypeId":".pagerduty",
         "group":"threshold met",
         "params":{
            "level":"info",
            "message":"alert \u0027{{alertName}}\u0027 is active for group \u0027{{context.group}}\u0027:\n\n- Value: {{context.value}}\n- Conditions Met: {{context.conditions}} over {{params.timeWindowSize}}{{params.timeWindowUnit}}\n- Timestamp: {{context.date}}"
         }
      }
   ],
   "tags":[
      "cpu"
   ],
   "notifyWhen":"onActionGroupChange",
   "name":"my cpu alert",
   "enabled":"true"

Does Kibana Alert API work for creating Elastic Stack Monitoring Alerts or only Kibana Alerts?

@Sumit_Gupta2 welcome to the community!
It's not clear from your question what the issue is with the alert. Do you have stack monitoring set up? Can Kibana read from those monitoring indices? Do you have a license > basic?
Alerts created in Kibana can only be done with indices that Kibana has access to.

Thanks @cheiligers . So I am looking for an API which will do stack monitoring, do we have one?

There's a bit more involved with setting up monitoring but it's not too complicated!
There are some great walk-throughs in the elastic docs and I'd start with this introduction.
Here's a link to the monitoring docs: Stack Monitoring | Kibana Guide [7.13] | Elastic
There's a whole forum on monitoring if you need some advice.

Thanks @cheiligers . Do you know the api endpoint for configuring stack monitoring alerts please?

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.