# Error when connecting Prometheus Datasource

**URL:** <https://community.grafana.com/t/error-when-connecting-prometheus-datasource/112468>\
**Category:** Prometheus\
**Created:** [January 21, 2024, 8:15pm UTC](https://community.grafana.com/t/error-when-connecting-prometheus-datasource/112468 "2024-01-21T20:15:12Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![td15392](https://avatars.discourse-cdn.com/v4/letter/t/e19adc/32.png) [@td15392](https://community.grafana.com/u/td15392)\
**Post date:** [January 21, 2024, 8:15pm UTC](https://community.grafana.com/t/error-when-connecting-prometheus-datasource/112468/1 "2024-01-21T20:15:12Z")

</div>

Hi guys,

I am new to both Grafana and Prometheus.  
I am using Grafana 10.2.3 on MacOS (Ventura 13.2.1), with Prometheus 2.49.1

I am trying to connect a new Prometheus datasource from a custom exporter.

I was abled to successfully create a datasource from the default Prometheus job.  
I am trying to do the same with a custom exporter and I have added a new scrape\_config to the prometheus.yml as follows.

- job\_name: “test”  
static\_configs:
  - targets: [“localhost:64502”]

However when I try to do add it as a data source and try to save and test, I get the following error.

ReadObject: expect { or , or } or n, but found #, error found in #1 byte of …|# HELP pyth|…, bigger context …|# HELP python\_gc\_objects\_collected\_total Objects co|… - There was an error returned querying the Prometheus API.

I can provide more details if needed.

Can you please help me figure out what I am doing wrong?

Thanks in advance!

---

<div class="post-metadata">

**Author:** ![jangaraj](https://sea2.discourse-cdn.com/grafana/user_avatar/community.grafana.com/jangaraj/32/39197_2.png) [@jangaraj](https://community.grafana.com/u/jangaraj)\
**Post date:** [January 21, 2024, 10:16pm UTC](https://community.grafana.com/t/error-when-connecting-prometheus-datasource/112468/2 "2024-01-21T22:16:24Z")

</div>

Grafana Prometheus datasource should be connected to Prometheus server, not to Prometheus exporter.

---

<div class="post-metadata">

**Author:** ![td15392](https://avatars.discourse-cdn.com/v4/letter/t/e19adc/32.png) [@td15392](https://community.grafana.com/u/td15392)\
**Post date:** [January 22, 2024, 7:16am UTC](https://community.grafana.com/t/error-when-connecting-prometheus-datasource/112468/3 "2024-01-22T07:16:55Z")

</div>

Thank you for your reply.  
It works now.
