stephenyeargin / hubot-grafana

📈🤖 Query Grafana dashboards
http://docs.grafana.org/tutorials/hubot_howto/
MIT License
154 stars 48 forks source link

Pause/Unpause all alerts in one shot does not work #114

Closed liptanbiswas closed 5 years ago

liptanbiswas commented 5 years ago

Describe the bug Command graf pause all alerts and graf unpause all alerts does not work. Bot returns a permission denied error when trying in Slack. This is because the endpoint admin/pause-all-alerts is part of Grafana Admin API and it is clearly mentioned in Grafana documentation that The Admin HTTP API does not currently work with an API Token.

To Reproduce Steps to reproduce the behavior:

  1. Data source '...'
  2. Command entered myhubot graf unpause all alerts
  3. In slack it says permission denied. In Grafana logs its logged that grafana responded with 403.

Expected behavior It should pause all alerts in one go.

Software:

stephenyeargin commented 5 years ago

Context: This was introduced in #82 via @kongo2002.

Perhaps the endpoint restriction was introduced in a later version of Grafana?

liptanbiswas commented 5 years ago

@stephenyeargin Submitted a PR which iterates through all alerts of that organization and tries to pause/unpause one by one. Found this which says its a feature that Grafana admin api is not accessible using API keys, so I believe it is going to remain like that. Can you please review the PR and share your thoughts.

stephenyeargin commented 5 years ago

Fixed in v2.3.2.