Skip to content
Back to skills

Grafana Loki Knowledge Patch

ASecurity

Grafana Loki

  • 25 stars
  • 0 votes
  • 0 copies
  • 10 views
  • Added September 5, 2026
developmentgoswiftshellsqldockerkubernetesgitapifrontendbackend

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/badge)](https://www.skillsdirectory.com/skills/nevaberry-grafana-loki-knowledge-patch)

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

Load this skill for Loki upgrades, Helm or Operator deployment changes,
ingestion and storage configuration, LogQL and API behavior, or client and
operational troubleshooting. Use the topic references for complete guidance,
examples, and source links.

## Reference index

| Reference | Topics |
| --- | --- |
| [Upgrades and deprecations](references/upgrades-and-deprecations.md) | Chart migration, images, workload identity, removed settings, storage migration, bloom formats, caches, metrics |
| [Ingestion and metadata](references/ingestion-and-metadata.md) | Time sharding, structured metadata, OTLP, policies, ingestion limits, push responses |
| [Storage, deletion, and Kafka](references/storage-deletion-and-kafka.md) | Object-store clients, cache writeback, compactor workers, retention, Kafka, ingest-limits |
| [Queries, APIs, and patterns](references/queries-apis-and-patterns.md) | LogQL, v2 engine, API validation, scheduling, Logs Drilldown, Query-tee, Goldfish |
| [Helm and Operator](references/helm-and-operator.md) | Templates, storage, volumes, scheduling, probes, sidecars, networking, Operator configuration |
| [Clients, observability, and operations](references/clients-observability-and-operations.md) | Collectors, CLI tools, Docker logging, tracing, TLS, networking, WAL, shutdown |

## Upgrade and deprecation checks

### Chart distribution and image changes

Use the [community chart repository](https://github.com/grafana-community/helm-charts)
for Loki Helm chart updates. Follow the dedicated
[migration instructions](https://grafana.com/docs/loki/latest/setup/upgrade/upgrade-to-community/)
when moving from the 6.x chart to the 18.x community chart.

- Move telemetry collection and monitoring mixins from the meta-monitoring
  chart to the Kubernetes Monitoring Helm chart.
- The Loki image drops BusyBox and its shell. Use a separate debug container
  for interactive troubleshooting and update scripts that invoke that shell.
- The Promtail image dropped `wget`; update health checks and scripts that use it.
- Lambda-promtail is outside the scope of the Promtail deprecation.

### Helm values, workload identity, and StatefulSets

- Rename `object_store.prefix` to `object_store.storage_prefix` in chart values.
- For a sidecar-specific registry, move the hostname from
  `sidecar.image.repository` to `sidecar.image.registry`, leaving the repository
  path in `sidecar.image.repository`.
- When upgrading the 6.x chart, move a sidecar image hash from
  `sidecar.image.tag` to `sidecar.image.digest`.
- In chart 6.46.0, `serviceAccount.create: true` without an explicit name uses
  the fullname template, typically changing `loki` to `<release-name>-loki`.
  Preserve an existing workload identity binding by pinning `serviceAccount.name`
  to the previous account name (`loki` or `enterprise-logs`), or update the binding.
- If `ingester.zoneAwareReplication.enabled` is `true`, delete each zone-aware
  ingester StatefulSet with `--cascade=orphan` before upgrading to chart 6.34.0.
  This preserves claims and lets Helm recreate the StatefulSets with the corrected
  immutable `serviceName`.

### Storage and configuration migration

When upgrading to Loki 3.0:

- Remove `shared_store` from TSDB and BoltDB shippers. Each schema period's
  `object_store` serves chunks and indexes; copy or move existing index tables
  into that store wherever the old 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 is `index/`.
- Remove compactor `shared_store` and `shared_store_key_prefix`. Compaction and
  retention run across the stores from all TSDB and BoltDB Shipper schema periods.
- Set `compactor.delete_request_store` explicitly when enabling retention.
  `-compactor.delete-request-store.key-prefix` controls its prefix, defaulting to `index/`.
- Move runtime configuration `default` values to top-level `operational_config`
  in the main Loki configuration.
- 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.
- Replace `max_transfer_retries` with WAL replay for rolling restarts;
  `flush_on_shutdown` optionally writes chunks to storage at shutdown.
  Replace `/ingester/flush_shutdown` with `/ingester/shutdown?flush=true`.

The [upgrade reference](references/upgrades-and-deprecations.md) contains the
remaining removed settings, changed defaults, metric replacements, and CLI migration.

### Bloom migrations

For Loki 3.2, replace the bloom compactor with the bloom planner and builder.
Move `max-page-size`, `max-block-size`, `ngram-length`, `ngram-skip`,
`false-positive-rate`, and `block-encoding` flags from `-bloom-compactor.*` to
`-bloom-builder.*`, keeping existing `limits_config` YAML keys and dropping
the remaining bloom compactor options.

Before upgrading to Loki 3.3, delete objects under the configured object store's
`bloom/` prefix: earlier bloom blocks and metadata are incompatible with the new format.

## Ingestion and metadata

### Backfills and time sharding

For backfills that would otherwise hit the out-of-order ingestion window,
set this in the tenant's limits. Loki adds `__time_shard__` and splits streams
into windows of half `max_chunk_age`, normally one hour.

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

### Metadata and OTLP

Per-tenant extraction can add structured metadata from stream labels, existing
metadata keys, or keys parsed from JSON or logfmt lines. The distributor sanitizes
structured metadata at ingestion; check stored metadata when choosing filter names.

The default OTLP mapping promotes `deployment.environment.name` to a stream label.
Loki applies global OTLP configuration to a tenant's configuration only when that
tenant's OTLP settings are updated in the overrides. OTLP ingestion errors use
protobuf status messages; decode the response body on failed exports.

### Ingestion policies and limits

- Loki supports stream-to-policy mappings and a global policy, logs overlapping
  matches, and merges default mappings with tenant-specific mappings.
- Required stream labels and ingester stream limits can vary by policy.
  A policy can block ingestion; a blocked push can return HTTP `260`.
- Blocked-ingestion and enforced-label errors include the resolved policy.
  With `log_push_request` enabled, distributor push logs identify the policy.
- The `received_bytes` metric has a `policy` label; observed resource and
  metadata label reporting also accounts for the policy.
- Distributor dry-run mode evaluates ingestion-limit checks without rejecting
  pushes on that basis. `ingest-limits` can enforce a tenant's rate across the deployment.
- The distributor can cap received size after decompression; the default
  uncompressed receive-size limit is 100 MB. Account for uncompressed payloads
  when sizing batches from clients that compress pushes.
- The applied-limits endpoint reports effective tenant limits and returns
  defaults for unknown tenants. An allowlist can filter the returned limits.

## Storage and deletion

Experimental compactor workers process large delete requests or a backlog.
The main compactor delegates deletion jobs while performing index compaction
and retention itself. SQLite can store deletion requests; object storage can
hold chunk deletion markers so pending deletions can survive local disk loss.

Thanos clients support named stores and Swift, OSS, and BOS backends.
Enabling congestion control disables retries in the Thanos object-storage client.
The compactor can process deletion requests with the Thanos filesystem backend.

Logcli provides deletion commands. Read a submitted deletion request's ID from
the response header. Delete-request filters have access to structured metadata.

Kafka reading starts at the beginning of a partition when no committed offset
exists. The distributor stops writing to the Kafka metadata topic and removes
the tenant-topic tee; review consumers that relied on those writes.

## Queries, APIs, and patterns

### Parsing and metadata precedence

If parsing produces a label with the same name as structured metadata, the
original name 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`.
Use the `regexp` parser with named captures in v2 log queries.
Its `logfmt --strict` stops parsing at the
first malformed pair; `--keep-empty` retains empty values. The flags can combine:

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

V2 honors `categorizeLabels` to distinguish stream labels, structured metadata,
and parsed labels. `first_over_time`, `last_over_time`, and `quantile_over_time`
account for the range's `offset`.

### Request validation and failure handling

| Condition | Behavior |
| --- | --- |
| Push request has no streams | Distributor returns HTTP `422 Unprocessable Content` |
| Query exceeds the interval limit | HTTP `400 Bad Request` |
| Ruler request contains multiple tenant IDs | HTTP `400 Bad Request` |

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 range `1970-01-01T00:00:00Z` through `2262-04-11T23:47:16.854775807Z`.
Those versions fail requests the query frontend cannot encode while keeping
the scheduler stream open for other requests.

### Patterns and Logs Drilldown

Pattern persistence stores patterns as aggregated metrics that Logs Drilldown
can query. The distributor exempts aggregated metric streams from label
enforcement; the querier accepts aggregated metric queries only from Logs Drilldown.
Drilldown metric queries can return partial results, and a separate endpoint
exposes its configuration. The Patterns API supports queries across tenants.

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 pushes on
shutdown, retries HTTP `429` or `5xx` pattern pushes, and drops other `4xx` pushes.

## Deployment and operational checks

- The chart configures PVC deletion on StatefulSet deletion and retains PVCs
  on scale-down. Changing `volumeClaimTemplates` can cause StatefulSet recreation.
- The Operator rejects S3 endpoint URLs containing a path. On OpenShift 4.20,
  supply needed NetworkPolicies; the Operator skips automatic deployment there.
- Review existing LokiStack OTLP configuration before upgrading for the breaking
  OTLP attribute-dropping change.
- Install the Loki Operational app plugin for the browser UI. The chart UI switch
  enables supporting APIs on queriers; the gateway routes UI requests to them.
- Loki uses OpenTelemetry tracing and accepts `JAEGER_*` variables for exporting
  traces in Jaeger format.
- Use `loki health` for CLI health checks. Logcli accepts custom HTTP headers,
  offers `--log.level`, and can opt in to environment proxy settings.
- The Loki container starts in `/`; resolve relative paths against that directory.

Files in this skill

  • SKILL.md9.3 KB
  • coverage.json719 B
  • references/clients-observability-and-operations.md3.4 KB
  • references/helm-and-operator.md5.1 KB
  • references/ingestion-and-metadata.md3.6 KB
  • references/queries-apis-and-patterns.md3.7 KB
  • references/storage-deletion-and-kafka.md2.9 KB
  • references/upgrades-and-deprecations.md3.6 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.