Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unable to lookback logs older than 2-3h max(random number) #11301

Open
PratikC91 opened this issue Nov 23, 2023 · 4 comments
Open

Unable to lookback logs older than 2-3h max(random number) #11301

PratikC91 opened this issue Nov 23, 2023 · 4 comments

Comments

@PratikC91
Copy link

I have setup loki to collect logs from my docker swarm cluster and push it to s3, this works great for day to day use but if i want to see logs older than a particular time which seems to be random, i am unable to get the logs.
I can see all the logs being availabe in s3 but cant query them in loki.

Loki Config

auth_enabled: false

server:
  http_listen_port: 3100

common:
  instance_interface_names:
    - "lo"
  instance_addr: 127.0.0.1
  ring:
    instance_addr: 127.0.0.1
    instance_interface_names:
    - "lo"
    kvstore:
      store: inmemory
  replication_factor: 1
  path_prefix: /loki # Update this accordingly, data will be stored here.

schema_config:
  configs:
  - from: 2020-05-15
    store: boltdb-shipper
    object_store: s3
    schema: v11
    index:
      prefix: index_
      period: 24h

storage_config:
  boltdb_shipper:
    active_index_directory: /loki/index
    cache_location: /loki/index_cache
    shared_store: s3
  aws:
    s3: s3://ap-north-xyz/c---------logs
    s3forcepathstyle: true
    bucketnames: c--------logs
    region: aap-north-xyz
    access_key_id: ------------------
    secret_access_key: -------------------


compactor:
  working_directory: /loki/compactor
  shared_store: s3
  compaction_interval: 5m

promtail-config

server:
  http_listen_port: 9080
  grpc_listen_port: 0

positions:
  filename: /tmp/positions.yaml

clients:
  - url: http://loki:3100/loki/api/v1/push

scrape_configs:
  - job_name: scrape
    docker_sd_configs:
      - host: unix:///var/run/docker.sock
        refresh_interval: 5s
    relabel_configs:
      - source_labels: ['__meta_docker_container_name']
        regex: '/(.*)'
        target_label: 'container'
      - source_labels: ['__meta_docker_container_label_com_docker_swarm_service_name']
        target_label: 'service'
      - source_labels: ['__meta_docker_container_label_com_docker_stack_namespace']
        target_label: 'namespace'
Screenshot 2023-11-23 at 11 22 55 AM Screenshot 2023-11-23 at 11 23 35 AM Screenshot 2023-11-23 at 11 24 09 AM

how do i fix this?

@JStickler
Copy link
Contributor

Questions have a better chance of being answered if you ask them on the community forums.

@waney316
Copy link

waney316 commented Dec 4, 2023

i get the same problem,have you fix it ?

@tonyswu
Copy link

tonyswu commented Dec 4, 2023

Try changing your S3 configuration to:

storage_config:
  s3:
    bucketnames: c--------logs
    s3forcepathstyle: true
    region: aap-north-xyz
    access_key_id: ------------------
    secret_access_key: -------------------

You can also double check your configuration with the /config API endpoint. And as JStickler mentioned, please feel free to bring this to the forum and I'll be happy to engage with you there.

@summed
Copy link

summed commented Dec 7, 2023

Am experiencing somewhat similar issue, except I am using tsdb. The S3 is onprem minio...

Write to S3 doesn't seem to be an issue, just when reading.

My config:

storage:
  type: s3
  s3:
    region: null
    endpoint: http://10.10.10.10:80/loki-logging
    accessKeyId: xyz
    secretAccessKey: zyx
    s3ForcePathStyle: true
    insecure: true
storage_config:
  tsdb_shipper:
    shared_store: s3
schemaConfig:
  configs:
  - index:
      period: 24h
      prefix: index_
    object_store: s3
    schema: v12
    store: tsdb

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants