Open
Description
Describe the bug
We're getting the following error while querying for series older than X amount of time, possibly over midnight, in spite of having a very limited number of (unique) labels:
Error doing request: Error response from server: cardinality limit exceeded for {}; 141435 entries, more than limit of 100000
To Reproduce
Steps to reproduce the behavior:
- Started Loki
2.0.0
- Started Promtail
2.0.0-amd64
- Query:
{job="fw-log"}
Expected behavior
If the number of unique labels remain constant over time, series should be returned
Environment:
- Infrastructure: kubernetes
- Deployment tool: N/A
Screenshots, Promtail config, or terminal output
Grafana query:
{
"request": {
"url": "api/datasources/proxy/176/loki/api/v1/query_range?direction=BACKWARD&limit=1860&query=%7Bjob%3D%22fw-log%22%7D&start=1604275059000000000&end=1604278660000000000&step=2",
"hideFromInspector": false
},
"response": {
"error": "",
"response": "cardinality limit exceeded for {}; 141435 entries, more than limit of 100000\n",
"message": "cardinality limit exceeded for {}; 141435 entries, more than limit of 100000\n"
}
}
logcli
LALALA#logcli series '{job="fw-log"}' --analyze-labels --since=6h [0] 20-11-02 9:41:11
https://localhost/loki/api/v1/series?end=1604306474033385197&match=%7Bjob%3D%22fw-log%22%7D&start=1604284874033385197
Total Streams: 10
Unique Labels: 5
Label Name Unique Values Found In Streams
lvl 5 10
application 4 10
host 2 10
facility 1 10
job 1 10
LALALA#logcli series '{job="fw-log"}' --analyze-labels --since=7h [0] 20-11-02 9:41:14
https://localhost/loki/api/v1/series?end=1604306477218995589&match=%7Bjob%3D%22fw-log%22%7D&start=1604281277218995589
Total Streams: 11
Unique Labels: 5
Label Name Unique Values Found In Streams
lvl 5 11
application 4 11
host 2 11
facility 1 11
job 1 11
LALALA#logcli series '{job="fw-log"}' --analyze-labels --since=8h [0] 20-11-02 9:41:17
https://localhost/loki/api/v1/series?end=1604306480489553537&match=%7Bjob%3D%22fw-log%22%7D&start=1604277680489553537
Total Streams: 11
Unique Labels: 5
Label Name Unique Values Found In Streams
lvl 5 11
application 4 11
host 2 11
facility 1 11
job 1 11
LALALA#logcli series '{job="fw-log"}' --analyze-labels --since=9h [0] 20-11-02 9:41:21
https://localhost/loki/api/v1/series?end=1604306485172362222&match=%7Bjob%3D%22fw-log%22%7D&start=1604274085172362222
Error doing request: Error response from server: cardinality limit exceeded for {}; 141435 entries, more than limit of 100000
(<nil>)
LALALA#logcli series '{job="fw-log"}' --analyze-labels --since=9h [0] 20-11-02 10:00:38
https://localhost/loki/api/v1/series?end=1604307698329025099&match=%7Bjob%3D%22fw-log%22%7D&start=1604275298329025099
Total Streams: 11
Unique Labels: 5
Label Name Unique Values Found In Streams
lvl 5 11
application 4 11
host 2 11
facility 1 11
job 1 11
LALALA#logcli series '{job="fw-log"}' --analyze-labels --since=10h [0] 20-11-02 10:01:39
https://localhost/loki/api/v1/series?end=1604307701929571537&match=%7Bjob%3D%22fw-log%22%7D&start=1604271701929571537
Error doing request: Error response from server: cardinality limit exceeded for {}; 141435 entries, more than limit of 100000
(<nil>)
LALALA#