Grafana returned 404 on POST at /api/annotations

Hello there,

I am trying to interface the notification module in AWX (OpenSource version of Ansible Tower) with Grafana. When I tried to test the notification, I got the following errors in grafana - which returns the same error in AWX:

Mar 24 22:40:00 chris-home-lab grafana-server[4554]: t=2021-03-24T22:40:00+0000 lvl=info msg=“Request Completed” logger=context userId=0 orgId=1 uname= method=POST path=//api/annotations status=404 remote_addr=<AWX_server_IP> time_ms=29 size=33165 referer=

I tried to run the API call manually but I was able to make the annotation call successfully. Here is the API call:

chrislo@chris-home-lab:~ curl -X POST -H 'Authorization: Bearer <API TOKEN>' -H 'Content-Type: application/json' -d '{"dashboardId":2,"panelId":2,"text":"Trial"}' http://<grafana_server_ip>:3000/api/annotations {"id":16,"message":"Annotation added"} chrislo@chris-home-lab:~

If I get a 404 in both cases, then I am sure that I am not accessing the endpoint correctly; but I am able to when I run the API call manually, so I am kinda ran out of ideas on what causes the 404. Can someone point me to the right direction on where I should start looking? Thank you.

Regards,

Chris

It looks like a wrong URL in your code, see double slash - //api/annotations in your grafana logs. You have probably a typo in your code.

Hello jangaraj,

Thank you for getting back to me. I noticed that as well and made the adjustments, but I ran into a different error:

t=2021-03-30T04:38:57+0000 lvl=info msg=“Request Completed” logger=context userId=0 orgId=1 uname= method=POST path=/api/annotations status=400 remote_addr=192.168.86.105 time_ms=27 size=151 referer=

Looks like I will need to bring this up with the AWX guys to see what happened. Thank you very much.

Regards,

Chris

This topic was automatically closed after 365 days. New replies are no longer allowed.