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

Grafana Alerting Issue: tsdb.HandleRequest() error bad_response: bad response code 502 #12739

Closed
kamrajshahapure opened this issue Jul 27, 2018 · 7 comments · May be fixed by ekmixon/grafana#80

Comments

@kamrajshahapure
Copy link

kamrajshahapure commented Jul 27, 2018

While creating any alerts on Grafana, I am facing an error "tsdb.HandleRequest() error bad_response: bad response code 502" every single time, tried to find out but couldn't find the solution since nobody else had this issue in the past. Here is the screenshot for the same

image

Edit:

  1. Grafana version: 5.1.4
  2. Datasource: Prometheus 2.3.1

Thanks in Advance :)

@marefr
Copy link
Contributor

marefr commented Jul 27, 2018

What grafana version? What datasource and how have you configured it? Any proxy configured to be used for datasource?

@marefr marefr added the needs more info Issue needs more information, like query results, dashboard or panel json, grafana version etc label Jul 27, 2018
@kamrajshahapure
Copy link
Author

Hi,
I am using

  1. Grafana version: 5.1.4
  2. Datasource: Prometheus 2.3.1

(Added same info as an edit)

@marefr
Copy link
Contributor

marefr commented Jul 27, 2018

And my other questions? Screenshot of datasource configuration? Any proxy? Any special authentication?

@kamrajshahapure
Copy link
Author

The configuration of Prometheus is straightforward with no authentication and we have organization level proxy but Prometheus and Grafana are on same host though.

image

@marefr
Copy link
Contributor

marefr commented Jul 27, 2018

So what happens if you change access to Server? I guess it would fail. Server access mode is kind of how prometheus are accessed in when evaluating alerting rules

@kamrajshahapure
Copy link
Author

Yes I got the same bad gateway error,but later I tried my datasource to work on server access instead of browser access, and changed the servers address in the form of "http://ipaddress:port" and then the datasource started working fine.

After that I tried out alerting again, and now alerts are appearing on my Telegram channel
It was a trivial ignorance which caused issue :(
Glad that got a quick help, Thanks a ton

So the takeaway from this is "Always add datasources' access as server because that is how alerts access prometheus while evaluating alert rules"

@marefr
Copy link
Contributor

marefr commented Jul 27, 2018

Glad you worked it out. Browser access mode should only be used in the case of you cannot use server access mode due to special authentication or similar.

@marefr marefr closed this as completed Jul 27, 2018
@marefr marefr removed the needs more info Issue needs more information, like query results, dashboard or panel json, grafana version etc label Jul 27, 2018
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

Successfully merging a pull request may close this issue.

2 participants