Skip to content
Back to skills

Grafana Loki Knowledge Patch

ASecurity

Grafana Loki

  • 25 stars
  • 0 votes
  • 0 copies
  • 6 views
  • Added September 5, 2026
developmentgoswiftshellsqlexpressdockerkubernetesapifrontendbackend

Works with

  • cli
  • api

Security analysis

A100/100

Pro scans all 8 files and shows the line behind each finding

Scanned December 1, 2026

npx -y skills add Nevaberry/nevaberry-plugins --skill grafana-loki-knowledge-patch --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of Grafana Loki Knowledge Patch?

Add the live security badge to your README. It updates with every re-scan.

Security grade badge for Grafana Loki Knowledge Patch
[![Security: A — Skills Directory](https://www.skillsdirectory.com/api/skills/nevaberry-grafana-loki-knowledge-patch-nevaberry-plugins/badge)](https://www.skillsdirectory.com/skills/nevaberry-grafana-loki-knowledge-patch-nevaberry-plugins)

More formats (shields.io, HTML) on the badges page. Keep it an A: scan every change in CI with Pro.

Download with Pro
SKILL.md
---
name: grafana-loki-knowledge-patch
description: Grafana Loki
version: "3.7.11"
license: MIT
metadata:
  author: Nevaberry
---


# Grafana Loki Knowledge Patch

Load this skill when upgrading Loki or its Helm chart, configuring ingestion and storage,
working with LogQL and APIs, or operating LokiStack and log collection integrations.
Use the topic references for complete guidance, examples, and source links.

## Reference index

| Reference | Topics |
| --- | --- |
| [Migrations and breaking changes](references/migrations-and-breaking-changes.md) | Chart migrations, container changes, removed settings, storage migrations, defaults, metrics |
| [Ingestion, labels, and limits](references/ingestion-labels-and-limits.md) | Backfills, metadata, OTLP, policies, Kafka, distributed limits, patterns, WAL recovery |
| [Storage, deletion, and compaction](references/storage-deletion-and-compaction.md) | Thanos and provider clients, deletion requests, experimental workers, caches, index gateways |
| [Helm and deployment](references/helm-and-deployment.md) | Workloads, scheduling, volumes, configuration, networking, probes, canaries, server lifecycle |
| [Operator, integrations, and observability](references/operator-integrations-and-observability.md) | LokiStack, collectors, Docker logging, tracing, metrics, ruler diagnostics, operational UI |
| [Queries, APIs, and command-line tools](references/queries-apis-and-cli.md) | LogQL, v2 engine, API bounds, scheduling, Logcli, Lokitool, Query-tee, Goldfish |

## Breaking changes and deprecations

### Containers and collectors

- The Loki image drops BusyBox and its shell. Use a separate debug container for
  interactive troubleshooting and update scripts that invoke a shell in the Loki container.
- The Loki container starts in `/`; resolve relative paths against that directory.
- The Promtail image dropped `wget`; update health checks and scripts that call it.
- Lambda-promtail is outside the scope of the Promtail deprecation.
- The distributor stops writing to the Kafka metadata topic and removes the tenant-topic tee.
  Review consumers that relied on those distributor writes.

### Helm upgrades

- Use the community-maintained chart repository. Follow the dedicated migration instructions
  when moving from the 6.x chart to the 18.x community chart.
- For a sidecar-specific registry, move the hostname from `sidecar.image.repository` to
  `sidecar.image.registry`, leaving the repository path in `sidecar.image.repository`.
  Move a sidecar image hash from `sidecar.image.tag` to `sidecar.image.digest` for 6.x upgrades.
- In chart 6.46.0, `serviceAccount.create: true` without an explicit name uses the fullname
  template, typically changing `loki` to `<release-name>-loki`. Preserve workload identity
  bindings by pinning `serviceAccount.name` to the previous name or updating the binding.
- Before upgrading to chart 6.34.0 with `ingester.zoneAwareReplication.enabled: true`,
  delete each zone-aware ingester StatefulSet with `--cascade=orphan`. This preserves claims
  and lets Helm recreate StatefulSets with the corrected immutable `serviceName`.
- Rename `object_store.prefix` to `object_store.storage_prefix` in chart values.
- The chart disables the NGINX ServiceMonitor; check scraping if gateway metrics rely on it.
- Move telemetry collection and monitoring mixins from the meta-monitoring Helm chart to
  the Kubernetes Monitoring Helm chart.
- The chart configures PVC deletion on StatefulSet deletion and retains PVCs on scale-down.
  Changing `volumeClaimTemplates` can cause StatefulSet deletion and recreation.

### Core storage and configuration migrations

For Loki 3.0 migrations:

- Remove shipper `shared_store`. Each schema period's `object_store` serves chunks and
  indexes; copy or move existing index tables where the previous shipper store differed.
- Move custom shipper `shared_store_key_prefix` to `index.path_prefix` on each affected
  existing TSDB or BoltDB Shipper schema period. The default prefix is `index/`.
- Remove the compactor's `shared_store` and `shared_store_key_prefix`. Compaction and
  retention run across stores from all TSDB and BoltDB Shipper schema periods.
- Set `compactor.delete_request_store` explicitly when enabling retention.
- Replace `max_transfer_retries` with WAL replay for rolling restarts; optionally enable
  `flush_on_shutdown`. Replace `/ingester/flush_shutdown` with `/ingester/shutdown?flush=true`.
- Move runtime configuration `default` values to top-level `operational_config` in the main
  Loki configuration. The migration reference includes the other removed flags and defaults.
- Move `async_cache_write_back_concurrency` to `background.writeback_goroutines` and
  `async_cache_write_back_buffer_size` to `background.writeback_buffer`.
  Use `background.writeback_size_limit` to cap queued writeback by memory size.
- The write dedupe cache is deprecated; TSDB and BoltDB Shipper already operate without it.

For Loki 3.2, replace the bloom compactor with the bloom planner and builder; the migration
reference lists the flags to move and the YAML keys to keep. Before upgrading to Loki 3.3,
delete objects under `bloom/`: earlier bloom blocks and metadata are incompatible.

### Metrics and integration compatibility

- In Loki 3.0, update alerts using `loki_distributor_ingester_append_failures_total` to
  `loki_distributor_ingester_append_timeouts_total` for ingester append timeouts.
  The migration reference also includes embedded-cache replacements and metric prefix changes.
- For Loki 3.0 LogCLI `remote-schema`, set `schema-store` to the object store supplying the
  schema; this replaces use of `-boltdb.shipper.shared-store`.
- LokiStack OTLP attribute dropping is flagged as a breaking change; review existing
  LokiStack OTLP configuration before upgrading.
- On OpenShift 4.20, supply needed NetworkPolicies; the Operator skips automatic deployment.
- Use LokiStack S3 endpoint URLs without a path; the Operator rejects endpoints containing one.
- The ruler validates remote-write configuration; check it if an upgrade causes rejection.

## Ingestion and tenant limits

### Backfills and metadata

For backfills that would hit the out-of-order ingestion window, set this in the tenant's limits:

```yaml
shard_streams:
  time_sharding_enabled: true
```

Loki adds `__time_shard__` and splits streams into windows of half `max_chunk_age`, normally
one hour. The Operator enables time-based stream sharding in its generated configuration.

Configure structured metadata extraction per tenant from stream labels, existing metadata,
or JSON/logfmt log-line keys. The distributor sanitizes metadata on ingestion; check stored
metadata when choosing query field names. Discovered `service_name` is present for retention
matching and usage tracking even when the client omits it.

The default OTLP mapping promotes `deployment.environment.name` to a stream label. Global
OTLP configuration is applied to a tenant's configuration only when its OTLP settings are
updated in overrides. Decode protobuf status messages from failed OTLP response bodies.

### Limits and ingestion policies

- The uncompressed receive-size limit defaults to 100 MB. Size compressed client batches
  with the decompressed payload in mind. Empty pushes with no streams return HTTP `422`.
- Distributor dry-run mode evaluates ingestion checks without rejecting pushes on that basis.
- Loki maps streams to policies, supports a global policy, logs overlapping matches, and
  merges default mappings with tenant mappings. `log_push_request` logs identify the policy.
- Required stream labels and ingester stream limits can vary by policy. A blocked push can
  return HTTP `260`; blocked-ingestion and enforced-label errors include the resolved policy.
- The `received_bytes` metric has a `policy` label. Observed resource and metadata label
  reporting also accounts for policy.
- The applied-limits endpoint reports effective tenant limits, returns defaults for unknown
  tenants, and can filter returned limits with an allowlist.
- `ingest-limits` can enforce tenant rates across the deployment and synchronously enforces
  stream counts per partition. A partition can reject new streams as soon as its limit is reached.
- With no committed Kafka offset, Loki reads from the partition's beginning.

## Queries and API behavior

### Metadata precedence and v2 parsing

If parsing produces a label with the same name as structured metadata, the original name
still resolves to the structured metadata value. This matches metadata `status=ready` even
when the logfmt line contains `status=failed`:

```logql
{app="worker"} | logfmt | status="ready"
```

The v2 engine supports `min`, `max`, `min_over_time`, and `max_over_time`. Its log queries
support `regexp` with named captures. Its `logfmt --strict` stops parsing a line at the first malformed pair;
`--keep-empty` retains keys with empty values. The flags can be combined:

```logql
{app="web"} | logfmt --strict --keep-empty
```

The v2 engine honors `categorizeLabels` to distinguish stream labels, structured metadata,
and parsed labels. For LogQL range evaluation, `first_over_time`, `last_over_time`, and
`quantile_over_time` account for the range's `offset`. Byte-valued label filters can compare a parsed field with zero.

### Request limits, timestamps, and failures

- Exceeding the query interval limit returns HTTP `400 Bad Request`. The ruler also returns
  HTTP `400 Bad Request` for requests with multiple tenant IDs.
- Loki 3.7.9 enforces request body size limits on `CreateRuleGroup` and `LogQLAnalyzer`.
- Loki 3.6.23 and 3.7.11 reject HTTP timestamps outside the inclusive bounds
  `1970-01-01T00:00:00Z` and `2262-04-11T23:47:16.854775807Z`.
- In those same releases, the query frontend fails requests it cannot encode and keeps the
  scheduler stream open for other requests.
- In Loki 3.7.11, the querier reconnects query workers without backoff after cancellation.

### Logs Drilldown and patterns

The distributor exempts aggregated metric streams from label enforcement; the querier
accepts aggregated metric queries only from Logs Drilldown. Persisted patterns are stored
as aggregated metrics and can be queried by Logs Drilldown. Its metric queries can return
partial results, and a separate endpoint exposes its configuration.

In Loki 3.7.10, LogQL skips every new series encountered after a Logs Drilldown query reaches
its series limit. Loki 3.7.11 drains buffered pattern aggregation pushes on shutdown, retries
pattern pushes returning HTTP `429` or `5xx`, and drops pushes returning other `4xx` responses.

## Storage and deletion

- Experimental compactor workers process large delete requests or backlogs. The main
  compactor delegates deletion jobs and performs index compaction and retention itself.
- SQLite can store deletion requests. Object storage can hold chunk deletion markers so
  pending chunk deletions can survive loss of the compactor's local disk.
- Deletion filter expressions have access to structured metadata. Read the request ID from
  the submission response header; Logcli provides commands to manage deletion requests.
- Thanos clients support named stores and Swift, OSS, and BOS backends. Enabling congestion
  control disables Thanos client retries. Thanos storage prefixes accept hyphens.
- Configure the S3 chunk key delimiter for MinIO on Windows. The legacy S3 client handles
  index filenames correctly with `chunk_delimiter`; the provider reference retains attribution.
- Configure a duration cutoff to skip writeback of older chunks fetched by queriers.

## Deployment, tools, and observability

- The chart supports external Memcached and a second-level Memcached chunk cache.
- Helm evaluates templates in read/write/backend pod settings, `loki.operational_config`,
  `pattern_ingester`, and `ingester_client`; `extraObjects` accepts a list or dictionary.
- The chart's `preStop` hook requests flushing with `flush=true`. The deployment reference
  details workload-specific probes, volume settings, topology constraints, and init containers.
- Use `loki health` for CLI health checks. Logcli supports custom request headers, opt-in
  environment proxy settings, shared output labels, and diagnostic verbosity via `--log.level`.
- Loki uses OpenTelemetry tracing and accepts `JAEGER_*` variables for Jaeger-format export.
- Install the Loki Operational app plugin for the browser UI. The chart's UI switch enables
  supporting APIs on queriers; the gateway routes UI requests to those queriers. Native ingress
  can expose operational UI endpoints for deployments without an NGINX gateway.
- Query-tee can race backends and split queries. Only sampled queries are duplicated for
  comparison; other queries pass through. Backend response headers are forwarded to clients.
- Goldfish shows query samples with user, engine, and trace ID; the samples record whether
  the query came from Logs Drilldown. It exposes stored results and comparison statistics
  and classifies differences using tolerance.

Files in this skill

  • SKILL.md10.2 KB
  • coverage.json718 B
  • references/helm-and-deployment.md6.3 KB
  • references/ingestion-labels-and-limits.md5.5 KB
  • references/migrations-and-breaking-changes.md5.6 KB
  • references/operator-integrations-and-observability.md5.7 KB
  • references/queries-apis-and-cli.md6.2 KB
  • references/storage-deletion-and-compaction.md5.7 KB

Attribution

Is this your skill, or is something wrong with this listing? Request removal or report an issue. Author removals are honored within 72 hours.

View all in development →

Comments

Loading comments…

Newsletter

Get the weekly list of safe new skills, and the ones we pulled.