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

The alertmanger send notifys results 403 #205

Closed
sundy-li opened this issue Dec 8, 2019 · 6 comments
Closed

The alertmanger send notifys results 403 #205

sundy-li opened this issue Dec 8, 2019 · 6 comments

Comments

@sundy-li
Copy link

sundy-li commented Dec 8, 2019

From the alertmanager log, it shows 403 when sending notify to Promgen.

level=error ts=2019-12-08T09:57:48.364Z caller=dispatch.go:301 component=dispatcher msg="Notify for alerts failed" num_alerts=1 err="cancelling notify retry for \"webhook\" due to unrecoverable error: unexpected status code 403: http://172.24.72.111:8082/alert"
@sundy-li
Copy link
Author

sundy-li commented Dec 8, 2019

My promgen web is http://172.24.72.111:8082/.

I guess there must be a url router for promgen to accept request to save the alerts for alertworker (No CSRF, No cookie needed)

@kfdm
Copy link
Collaborator

kfdm commented Dec 8, 2019

Sorry for the confusion
/alert is an older route that has been removed, the correct route is /api/v1/alerts
I will update the incorrect documentation

@sundy-li
Copy link
Author

sundy-li commented Dec 9, 2019

The '/api/v1/alerts' seems to be a proxy api which fetches the alerts from alertmanager.

I think the promgen must have a route which alertmanager can push alerts to save to the mysql.
So that the alert worker could consume and notify.

@sundy-li
Copy link
Author

sundy-li commented Dec 9, 2019

image

I can read the alert from web-ui, but I can't receive any notification.

@kfdm
Copy link
Collaborator

kfdm commented Dec 9, 2019

/proxy/v1/alerts is used for the Alertmanager route

# Alertmanager Proxy
# Promgen does not pretend to be an Alertmanager so these can be slightly different
path("proxy/v1/alerts", csrf_exempt(proxy.ProxyAlerts.as_view()), name="proxy-alerts"),
# Promgen API
path('api/v1/alerts', csrf_exempt(views.Alert.as_view()), name='alert'),

though I do want to do a bit of refactoring in the near future to better distinguish the Prometheus/Alertmanager proxy from the Promgen APIs

@sundy-li
Copy link
Author

sundy-li commented Dec 9, 2019

I am new to Django, but I figure out that now, thank you very much.

@sundy-li sundy-li closed this as completed Dec 9, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants