# 502 error adding data source (prometheus)

**URL:** <https://community.grafana.com/t/502-error-adding-data-source-prometheus/15429>\
**Category:** Prometheus\
**Created:** [March 17, 2019, 6:22am UTC](https://community.grafana.com/t/502-error-adding-data-source-prometheus/15429 "2019-03-17T06:22:50Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![kasunraj](https://sea2.discourse-cdn.com/grafana/user_avatar/community.grafana.com/kasunraj/32/6369_2.png) [@kasunraj](https://community.grafana.com/u/kasunraj)\
**Post date:** [March 17, 2019, 6:22am UTC](https://community.grafana.com/t/502-error-adding-data-source-prometheus/15429/1 "2019-03-17T06:22:50Z")

</div>

Hi All,

Grafana Version - 6.0.0

I used the helm chart to install Grafana & prometheus on Azure Kubernetes Cluster

When I try to add the prometheus as a data source it gives me a Bad Gateway error as bellow.

2019/03/17 06:07:12 http: proxy error: dial tcp 10.0.226.40:9090: i/o timeout  
t=2019-03-17T06:07:12+0000 lvl=info msg=“Request Completed” logger=context userId=1 orgId=1 uname=admin method=GET path=/api/datasources/proxy/1/api/v1/query status=502 remote\_addr=127.0.0.1 time\_ms=30001 size=0 referer=[http://grafana.staged-by-discourse.com/datasources/edit/1/](http://grafana.staged-by-discourse.com/datasources/edit/1/)

**10.0.226.40** is the IP of the prometheus service. some suggest to add the IP of the prometheus pod but if the pod is rescheduled or created IP would change. So I dont think its the best solution

 ![22%20AM](https://us1.discourse-cdn.com/grafana/original/2X/6/61611144f7b4a98e7c44976f6417a7fb7856d986.jpeg)

Thanks
