We are working on PLG (promtail , loki and grafana) stack setup , loki is deployed in distributed microservice mode . Promtail and loki is working as expected but when trying to add loki as a datasource in grafana dashboard we are getting the below error (PFA screenshot for the same). Can you please help on this.
Unable to fetch labels from Loki (Failed to call resource)
Please consider these logs to investigate. Also let me know if you need any other details. We tried a lot of things as per document but still no luck. Not sure what we are missing.
Was this issue resolved? I am experiencing this issue as well, I can curl loki from my grafana server fine, but testing the datasource on the grafana UI fails.
I ran into this exact issue today. I am using Promtail running locally on my windows computer together with Loki. Both Promtail and Loki were running with zero issues or errors but Grafana still showed “failed to call resource”.
What worked for me (and has worked once before is).
shut down Loki and Promtail
Delete the Loki configuration folder (for me /tmp/*) which deletes all chunks, index files and so on.
restart Loki and Promtail and wait for a while. Promtail needs to scrape and send to Loki, which is not the fastest due to my setup
reload community.grafana.com. Remove the data source Loki and remake it.
Done
It makes no sense to me but perhaps others will find this works for them too.
Same issue here. I upgraded grafana from 8.3.11 to 9.3.6 (where it worked fine) and started seeing this issue.
The only trace of this issue in logs is: logger=context userId=1 orgId=1 uname=admin t=2023-02-21T14:45:04.833177993Z level=error msg="Request Completed" method=GET path=/api/datasources/4/resources/labels status=500 remote_addr=89.79.107.126 time_ms=1 duration=1.809072ms size=51 referer=https://logs.theguru.co/datasources/edit/7Rn3jrJVk handler=/api/datasources/:id/resources/* which does not say much