What happened?
When we try time series visualization of Logs when Loki as Datasource, we get
graph and logs only upto last 2 hrs of timespan. If we increase the time range or use older time its not getting the data on dashboard. Also its not deleting any data from storage bucket older than retention period.
What did you expect to happen?
We should able to get the data on dashboard for atleast 24 hrs or for time whatever our retention period is. It should delete the older data from storage and retrieve all available data.
Did this work before?
Yes this worked before and we were getting all the logs when using filesystem as storage in loki-config.yaml but when we started using digitalocean space storage buckets its started showing only recent 2 hrs of data. Also using the limits_config as given below the log retrival work for one time.
max_query_series: 50000
max_entries_limit_per_query: 100000
How do we reproduce it?:
- Use Alloy to send logs to Loki and Loki as Data source in Grafana
- First use filesystem as log storage option and then switch to storage space buckets.
Is the bug inside a dashboard panel?
No, this bug is not inside dashboard panel.
Environment (with versions):
- Grafana version: Version 12.0.2
- Operating system: Ubuntu 22.04
- Browser: Chrome Version 138.0.7204.97 (Official Build) (64-bit)
- Datasource version(s) (prometheus, graphite, etc.): Loki “version”:“3.5.1”
- Plugins: Loki
Configuration information:
Alloy agent, Loki and Grafana all are installed on single ubuntu server. Alloy fetch the logs and forward it to Loki. Loki store the log data to digitalocean storage buckets and Grafana is configured with Loki as data source manually from UI. The Loki config file is as given below.
auth_enabled: false
server:
http_listen_port: 3100
grpc_listen_port: 9096
log_level: info
grpc_server_max_concurrent_streams: 2000
common:
instance_addr: 127.0.0.1
path_prefix: /tmp/loki
storage:
#filesystem:
# chunks_directory: /tmp/loki/chunks
# rules_directory: /tmp/loki/rules
s3:
endpoint: https://xxxxxx.blr1.digitaloceanspaces.com
bucketnames: Loki
region: blr1
access_key_id: DxxxxxxxxxxxxxR
secret_access_key: bxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxY
s3forcepathstyle: true
replication_factor: 1
ring:
kvstore:
store: inmemory
query_range:
results_cache:
cache:
embedded_cache:
enabled: true
max_size_mb: 100
limits_config:
metric_aggregation_enabled: true
allow_structured_metadata: true
volume_enabled: true
retention_period: 24h # 24h
max_query_series: 50000
max_entries_limit_per_query: 100000
schema_config:
configs:
- from: 2025-07-04
store: tsdb
//#### object_store: filesystem
object_store: s3
schema: v13
index:
prefix: index_
period: 24h
pattern_ingester:
enabled: true
metric_aggregation:
loki_address: localhost:3100
ruler:
enable_alertmanager_discovery: true
enable_api: true
frontend:
encoding: protobuf
compactor:
working_directory: /tmp/loki/retention
delete_request_store: s3
retention_enabled: true
retention_delete_delay: 2h




