0

I'm experiencing issues retrieving log data from Loki in my Grafana dashboard. I've configured Loki to collect logs from various instances using Promtail, but I'm encountering an error when trying to query the logs. Error Message:

Status: 500. Message: Get "http://localhost:3100/loki/api/v1/query_range?direction=backward&end=1726510141705000000&limit=1000&query=topk%2810%2C+sum+by+%28user_agent%29+%28count_over_time%28%7Bfilename%3D~%22%2Fvar%2Flog%2Fapache2%2Faccess%5C%5C.log%7C%2Fvar%2Flog%2Fapache2%2Ferror%5C%5C.log%7C%2Fvar%2Flog%2Fapache2%2Fother_vhosts_access%5C%5C.log%7C%2Fvar%2Flog%2Fauth%5C%5C.log%7C%2Fvar%2Flog%2Fsyslog%7C%2Fvar%2Flog%2Fubuntu-advantage-timer%5C%5C.log%22%2C+job%3D~%22.%2A%22%7D+%7C++__error__%3D%22%22+%5B15m%5D%29%29%29&start=1726509241705000000&step=1000ms": EOF

This is my loki config file:

auth_enabled: false

server:
  http_listen_port: 3100
  grpc_listen_port: 9096
  http_server_read_timeout: 300s
  http_server_write_timeout: 300s
  http_server_idle_timeout: 300s

common:
  path_prefix: /tmp/loki
  storage:
    filesystem:
      chunks_directory: /tmp/loki/chunks
      rules_directory: /tmp/loki/rules
  replication_factor: 1
  ring:
    kvstore:
      store: inmemory

schema_config:
  configs:
    - from: 2020-10-24
      store: boltdb-shipper
      object_store: filesystem
      schema: v11
      index:
        prefix: index_
        period: 24h

ruler:
  alertmanager_url: http://localhost:9093

query_scheduler:
  max_outstanding_requests_per_tenant: 4096

frontend:
  max_outstanding_per_tenant: 4096

query_range:
  parallelise_shardable_queries: true

ingester:
  chunk_idle_period: 15m  # This increases the idle period before flushing a chunk
  max_chunk_age: 2h  

limits_config:
  split_queries_by_interval: 5m
  max_query_parallelism: 64
  max_streams_per_user: 30000
  max_global_streams_per_user: 0

And this is my loki service file:

[Unit]
Description=Loki service
After=network.target

[Service]
Type=simple
User=loki
ExecStart=/usr/local/bin/loki-linux-amd64 -config.file /usr/local/bin/config-loki.yml

[Install]
WantedBy=multi-user.target

This is the image of the error: enter image description here

I am using these versions: loki 2.4.7_4 Grafana Version 10.1.1

While loading everything in dashboard, it is taking a lot of time. I checked the CPU utilization, and it's approximately 30-40%.

I also checked through explorer in grafana still getting the same error.

Can anyone help me resolve this error? I have been trying to fix it for a long time but haven't succeeded.

1 Answer 1

0

Try to increase Queries maximum lines in loki data source config screensot

Sign up to request clarification or add additional context in comments.

2 Comments

I tried but it didn't work, still getting same error :(
Your answer could be improved with additional supporting information. Please edit to add further details, such as citations or documentation, so that others can confirm that your answer is correct. You can find more information on how to write good answers in the help center.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.