Thanks for the quick response! Here’s our configuration and additional findings.
### Loki Configuration (sanitized)
```yaml
auth_enabled: false
common:
compactor_grpc_address: ‘loki-backend.logging.svc.cluster.local:9095’
path_prefix: /var/loki
replication_factor: 3
storage:
s3:
access_key_id: ${LOKI_S3_ACCESS_KEY}
bucketnames: ${LOKI_S3_BUCKET_NAME}
endpoint: ${LOKI_S3_ENDPOINT}
http_config:
response_header_timeout: 15s
insecure: false
s3forcepathstyle: true
secret_access_key: ${LOKI_S3_SECRET_KEY}
ruler:
alertmanager_url: http://prometheus-kube-prometheus-alertmanager.prometheus:9093
enable_api: true
storage:
s3:
access_key_id: ${LOKI_S3_ACCESS_KEY}
bucketnames: ${LOKI_S3_BUCKET_NAME}
endpoint: ${LOKI_S3_ENDPOINT}
http_config:
response_header_timeout: 15s
insecure: false
s3forcepathstyle: true
secret_access_key: ${LOKI_S3_SECRET_KEY}
type: s3
wal:
dir: /var/loki/ruler-wal
storage_config:
hedging:
at: 250ms
max_per_second: 20
up_to: 3
use_thanos_objstore: false
schema_config:
configs:
index:
period: 24h
prefix: loki_index_
object_store: s3
schema: v11
store: boltdb-shipper
index:
period: 24h
prefix: loki_tsdb_index_
object_store: s3
schema: v13
store: tsdb
# Other relevant settings
limits_config:
max_query_length: 2165h
max_query_parallelism: 50
query_timeout: 5m
```
### Additional Findings
After further investigation, we discovered the root cause:
**The rules ARE being persisted to S3** - we verified this by listing objects in the bucket:
```
rules/fake/YWxsb3ktazYtY29yZS10ZXN0LXNjOTAtd29ya2Zsb3dzLWxvZy1hbGVydHMt…/c2M5MC13b3JrZmxvd3MtbG9nLWFsZXJ0cw==
```
**The issue is with GetObject, not PutObject.** Our S3-compatible storage (Dell ECS) is returning HTTP 500 errors on ~20% of GetObject requests:
| Operation | Success (200) | Failure (500) | Error Rate |
|-----------|---------------|---------------|------------|
| GetObject | 1,600,817 | 401,454 | **20%** |
| PutObject | 304,792 | 1 | ~0% |
This explains why:
1. `msg=“stored rulegroup”` appears (PutObject succeeds)
2. `msg=“failed to get rule group”` appears immediately after (GetObject fails)
3. Rules work intermittently (when GetObject succeeds)
### S3 Metrics from Loki
```
loki_s3_request_duration_seconds_count{operation=“S3.GetObject”,status_code=“200”} 1600817
loki_s3_request_duration_seconds_count{operation=“S3.GetObject”,status_code=“500”} 401454
loki_s3_request_duration_seconds_count{operation=“S3.PutObject”,status_code=“200”} 304792
loki_s3_request_duration_seconds_count{operation=“S3.PutObject”,status_code=“500”} 1
```
### Questions
1. Is there any known compatibility issue between Loki’s AWS SDK v2 client and S3-compatible storage like Dell ECS?
2. Would enabling `use_thanos_objstore: true` use a different S3 client that might behave differently?
3. Are there any recommended S3 client settings for non-AWS S3-compatible storage?
### Environment
- **Loki Version:** 3.6.10
- **Deployment:** Kubernetes (loki-distributed helm chart)
- **S3 Storage:** Dell ECS (S3-compatible)
- **Ruler Target:** `backend` component
Thanks for any insights!