Repository navigation
Description
Problem or Motivation
The Loki pattern ingester is off. On 2026-11-12, the Grafana MCP tool query_loki_patterns with the selector {namespace="devops"} returned HTTP 404 ("loki API returned status code 404"). The Patterns tab of Logs Drilldown (grafana-lokiexplore-app 3.1.0, installed) is empty.
k8s/logging/loki-values.yamlsets nopattern_ingestervalue. Thus the default of chart 21.2.1 applies:pattern_ingester: enabled: false(chartvalues.yaml:850-851).- The live Loki
/config(through the Grafana data source proxy) givespattern_persistence_enabled: false. The other Drilldown settings are on:allow_structured_metadata: true,volume_enabled: trueanddiscover_log_levels: true.
With patterns, an agent reads a small number of templates with counts, not many log lines (AGENTS.md rule 14). A new error shape shows in triage, with no query.
Limit: the pattern ingester keeps patterns in memory for 3 h (retain_for: 3h0m0s), and pattern persistence is off. The querier reads patterns only from the ingester window (Loki v3.7.9 pkg/querier/http.go:452-464). Thus patterns are for triage. A weekly review cannot use them.
Proposed Solution & Architectural Design
In k8s/logging/loki-values.yaml, under loki: (line 8), add this value:
pattern_ingester:
enabled: true- Chart 21.2.1 writes this value into the Loki configuration (chart
values.yaml:353-356). - In Loki v3.7.9, the
alltarget of the Monolithic mode includesPatternIngester(pkg/loki/loki.go:866). Its ring uses the memberlist that runs now. - Keep pattern persistence off. Pattern persistence writes pattern streams back into Loki. Make that a separate decision later.
- The change adds no pod, no NetworkPolicy change and no egress.
Risk: a small memory increase in loki-0, and one Loki restart. Loki holds 97 active streams (sum(loki_ingester_memory_streams)) at approximately 13 lines/s (sum(rate(loki_distributor_lines_received_total[1h]))). Each stream holds a maximum of 300 patterns. In 7 d, the peak working set of Loki was 452 MiB of its 2048Mi limit. The patterns come from log lines that Loki stores now, so no new data leaves the cluster.
Target Subsystem
Kubernetes & Minikube Automation (k8s/logging/).
Existing Tool Considered
The Loki pattern ingester (Grafana Labs, part of the deployed Loki v3.7.9) and Logs Drilldown 3.1.0 (installed). The Grafana documentation says: "Enable pattern ingestion by setting pattern_ingester.enabled to true" (https://grafana.com/docs/grafana-cloud/learn-and-build/visualizations/simplified-exploration/logs/access/). Loki is AGPL-3.0. It runs now as a separate service, and this change is configuration only. No new code.
Acceptance Criteria
-
helm templateof chartgrafana-community/loki21.2.1 withk8s/logging/loki-values.yamlwritespattern_ingester:withenabled: trueinto the Loki configuration. - After the Argo CD sync, the Loki
/configendpoint givespattern_ingesterwithenabled: true. - The Grafana MCP
query_loki_patternswith{namespace="devops"}over the last 1 h returns HTTP 200 and one or more patterns. - The Patterns tab of Logs Drilldown shows patterns for the
devopsnamespace. - For 24 h after the change,
max_over_time(container_memory_working_set_bytes{namespace="logging", container="loki"}[24h])stays below 80 % of the 2048Mi limit. The pull request gives the value before and after the change.
Related
#4989 (cluster integration plan), #5172 (Loki ruler: fewer 7-day line scans).
Owner approved on 2026-11-12.
Activity
dan-petty commentedon Nov 12, 2026
Both edit k8s/logging/loki-values.yaml for the same chart, but #2441 renames the deployment mode while this candidate enables the pattern ingester.feat(monitoring): turn on the Loki pattern ingester (#5260)
devops-cli-service commentedon Nov 15, 2026
Released in v0.153.0: https://github.com/dan-petty/devops-cli/releases/tag/v0.153.0
devops-cli-service commentedon Nov 15, 2026
Live since 2026-11-15 13:55 UTC