Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Ability to create an Alert Groups via the public API #2762

Closed
njohnstone2 opened this issue Aug 7, 2023 · 3 comments
Closed

Ability to create an Alert Groups via the public API #2762

njohnstone2 opened this issue Aug 7, 2023 · 3 comments
Assignees
Labels
feature request New feature or request part:alert flow & configuration type/docs Grafana Labs internal. Docs Squad label across all Grafana Labs repos

Comments

@njohnstone2
Copy link
Contributor

What would you like to see!

According to the docs only get and delete are supported for alert groups. It would be really useful to be able to create an ad hoc alert group via the API. This functionality is currently supported in the UI and slack slash commands.

My use case is that I have application code that runs in response to events in my cloud account. I'd like the ability to trigger oncall alerts when these events occur.

example payload being used by the UI (internal API)

{
  "team": "<TEAM_ID>",
  "title": "my test alert",
  "message": "testing manually created alerts",
  "users": [],
  "schedules": [
    {
      "important": false,
      "id": "<SCHEDULE_ID>"
    }
  ]
}

Product Area

Alert Flow & Configuration

Anything else to add?

Workaround

My current work around is to publish these events as a metric which can be used in an alerting rule. This works for triggering the alert but due to the nature of events (firing then shortly after returning to 0) the alert will quickly return to a healthy state without necessarily being acknowledged by the person oncall.

@github-actions
Copy link
Contributor

github-actions bot commented Aug 7, 2023

The current version of Grafana OnCall, at the time this issue was opened, is v1.3.22. If your issue pertains to an older version of Grafana OnCall, please be sure to list it in the PR description. Thank you 😄!

@njohnstone2
Copy link
Contributor Author

This turned out to be user error. In this case, alerts should be created using the inbound webhook/formatted webhook integrations.

Is it worth mentioning this integration on the HTTP API docs? As i was clearly looking in the wrong place.

@Matvey-Kuk Matvey-Kuk added the type/docs Grafana Labs internal. Docs Squad label across all Grafana Labs repos label Aug 18, 2023
@mjs
Copy link

mjs commented Feb 19, 2024

It might still be nice to be able to create alert groups via the API. As noted in #3912, submitting via an inbound webhook has some limitations.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature request New feature or request part:alert flow & configuration type/docs Grafana Labs internal. Docs Squad label across all Grafana Labs repos
Projects
None yet
Development

No branches or pull requests

6 participants