Grafana Unable to connect with Loki. Please check the server logs for more details

Hello, I’m having a problem trying to add my Loki as a datasource in my Grafana, both located in the same EKS cluster. I even did a kubectl exec -it grafana- -n monitoring – curl http://loki:3100 test and the test shows that both communicate normally.


This probably isn’t answerable without many more details of your setup - but you’re not trying to connect to http://loki:3100 you’re connecting to http://loki.monitoring:3100.

In these kinds of scenarios, 9 times out of 10, the issue isn’t anything to do with Grafana or Loki, but it has to do with DNS resolution and how it might be different on the grafana machine vs. where you’re testing it.

So the solution tends to involve diving into the EKS configuration to figure out what’s what. But the first step would be to try kubectl exec -it grafana- -n monitoring – curl http://loki.monitoring:3100

Hello Davi. All good? Thanks for answering! Below is an image of the log I obtained after running the command.

So now it makes sense why your loki connection is failing, because there’s no page there.

I can’t help with why that URL isn’t resolving, it depends too much on how your EKS deployment is setup. But you previously checked that http://loki:3100 worked, so try that. If that doesn’t work in your config, then I’m afraid you’ve got an EKS configuration issue, and you should post a different question with much more info about how loki & grafana are deployed.

Hi Davi, I got the same error.
I`m deploying the loki-distributed mode in a Openshif cluster



The component loki-loki-distributed-distributor is displaying this on the logs

What can I do?

For whoever stumble upon this issue, updating loki image to version 2.9.3 resolves mine.
Thank to romosa

Hey Davi, I am facing the same error in on-prem helm deployment could you please help me.