Failed to add Loki Data Source in Grafana.

36 views
Skip to first unread message

Vikash Rastogi

unread,
Feb 5, 2022, 6:36:04 AM2/5/22
to lokiproject

Describe the bug
I have Grafana, Loki and promtail on docker container and I am deploying the same using docker-compose file. When I am trying to add datasource in grafana then getting error : Loki: Bad Request. 400. invalid query, through < from (2022-02-05 08:17:17.579919544 +0000 UTC < 2022-02-05 10:42:50.783 +0000 UTC).

Host Machine : CentOS Linux release 7.6.1810 (Core)
Grafana Version : 8.4.2
Loki and Promtail version : 2.4.2

To Reproduce
Steps to reproduce the behavior:

  1. Deploy container using docker-compose file
  2. Trying to add datasource in grafana
  3. Getting the error.

Expected behavior
I need help to add Loki data source in grafana.

Environment:

  • Infrastructure:
    Host Machine : CentOS Linux release 7.6.1810 (Core)
    Grafana Version : 8.4.2
    Loki and Promtail version : 2.4.2
  • Deployment tool: Docker-compose

Docker-compose file for Loki-Promtail

version: '3'
services:
loki:
network_mode: host
image: "grafana/loki:2.4.2"
volumes:
- ./loki:/etc/loki
ports:
- "3100:3100"
command: -config.file=/etc/loki/loki-config.yaml
restart: always

promtail:
network_mode: host
image: "grafana/promtail:2.4.2"
volumes:
- ./promtail:/etc/promtail
- ../grafana-mongo-sync/log/grafana/grafana:/var/log/grafana
command: -config.file=/etc/promtail/promtail-config.yaml

Docker-compose file for grafana

version: '3'
services:
grafana:
network_mode: host
build:
context: ./grafana
image: "grafana/grafana:8.2.4"
volumes:
- ./data/grafana:/var/lib/grafana
- ./log/grafana:/var/log/grafana
- ./grafana/dashboards:/etc/grafana/provisioning/dashboards
- ./grafana/conf/grafana.ini:/etc/grafana/grafana.ini
env_file:
./grafana/env
ports:
- "3000:3000"
user: '472'
restart: always


DataSource_Addition_Error.JPG

Vikash Rastogi

unread,
Feb 5, 2022, 6:36:58 AM2/5/22
to lokiproject
Hi All,

Can anyone pleas help to resolve this issue?

Thanks in advance.

Reply all
Reply to author
Forward
0 new messages