Skip to content

Loki Patterns returns incomplete and inaccurate results in DrillDown Logs #21195

@kadjoudi

Description

@kadjoudi

Describe the bug
Over a 3-hour time window, Loki's pattern detection produces inaccurate and incomplete results:

  • Pattern counts don't match log totals : the count per pattern does not add up to the total number of logs in the selected time range.
  • Pattern detection is not representative : only one or very few patterns are identified, even when the log stream contains many distinct patterns. The patterns shown are not representative of the full log volume.

To Reproduce
Have a log stream
Open Grafana Drilldown → Logs → Patterns tab
Set the time range to ~3 hours
Observe that:
Pattern count per row does not sum to the total log count
Only 1–2 patterns are shown despite the UI indicating 51+ patterns exist
Filtering by log level (e.g. error) shows 0 patterns despite logs being present

Expected behavior
Pattern counts should be consistent with the total number of logs in the selected time range

Pattern detection should identify a representative set of patterns across the full time window, not just a narrow sample.

Environment:

  • Infrastructure: Cloud / AWS/ GCP

Screenshots, Promtail config, or terminal output
If applicable, add any output to help explain your problem.

Metadata

Metadata

Assignees

Type

No type
No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions