I am running Loki & Grafana as a standalone container in same host, containers are running fine with NO error.
when I adding Loki data source with local IP (host IP) I am getting following error.

But when I adding Loki data source with PUBLIC IP, I got connection.

For security reason its not meaning that I have to connect with Public IP.
Please advice.
Hello,
Are you running 2 container ? one for Grafana and one for Loki ?
If so you can't use localhost in Grafana as they don't share the same network stack.
If you need to connect those two containers within the same docker network. https://docs.docker.com/engine/reference/commandline/network_create/#connect-containers
Yes, I am running 2 container. One for Grafana and another one for Loki .
But when I am adding data source not using localhost , using host IP.
If you're on macos you can try this dns instead: http://docker.for.mac.localhost:3100/
I am using Linux but want use using as a standard host ip
Did you tried --network=host?
@Kuqd
Sorry delay in reply.
I tried with --network=host but no luck.
Most helpful comment
If you're on macos you can try this dns instead:
http://docker.for.mac.localhost:3100/