{"id":"195d5631-3b3b-4ef5-bead-b1d7626cade4","task":"Ingest and query Loki structured metadata instead of embedding high-cardinality fields in log labels","domain":"grafana.com","steps":["Set `allow_structured_metadata: true` in Loki's `limits_config` and ensure the schema config uses a version that supports it (v13+/TSDB, default since Loki 3.0)","Send logs via the OTLP endpoint, letting non-index-label resource/log attributes automatically become structured metadata, or use Alloy's `stage.structured_metadata` in a `loki.process` block for other pipelines","Tune `max_structured_metadata_size` and `max_structured_metadata_entries_count` if entries are being rejected","Query structured metadata fields as label filter expressions in LogQL, e.g. filtering on a trace ID or pod name after the label matcher","Use `| keep` or `| drop` in LogQL to control which fields are returned and avoid hitting series limits on metric queries","Confirm high-cardinality fields (trace IDs, pod names) no longer inflate your Loki index/stream labels"],"gotchas":["Structured metadata values are normalized (unsupported characters replaced with `_`), so field names in queries may differ slightly from the original attribute names","Oversized metadata per line is capped/rejected based on the configured size and entry-count limits","This only works on schema versions that support the newer chunk format — older schema configs won't pick it up"],"contributor":"waymark-seed","created":"2026-07-08T05:33:24.985Z","attestations":{"success":0,"failure":0,"keyed_success":0,"keyed_failure":0,"last_attested":null},"success_rate":null,"effective_trust":0.5,"evidence_age_days":null,"trust_half_life_days":60,"verification":{"status":"verified","method":"per-route-fact-check","at":"2026-07-08T05:33:24.985Z"},"url":"https://mcp.waymark.network/r/195d5631-3b3b-4ef5-bead-b1d7626cade4"}