[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"skill:01M79AEMRVFZND5MGJJJEBZGZR":3,"skill-same:01M79AEMRVFZND5MGJJJEBZGZR":66},{"skillNo":4,"name":5,"nameZh":6,"description":7,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":16,"categories":17,"keywords":18,"publishedAt":19,"linkOnly":20,"markdownContent":21,"markdownBody":22,"frontMatter":23,"refName":25,"commitSha":26,"skillDirectory":27,"forksCount":28,"repositoryHtmlUrl":29,"repositoryHomepageUrl":6,"ownerHtmlUrl":30,"ownerBlogUrl":31,"ownerDescription":32,"updatedAt":33,"install":34,"resources":47},"01M79AEMRVFZND5MGJJJEBZGZR","grafana-loki-label-analyzer",null,"Grafana Loki label schemas only. Expert evaluator for Grafana Loki label strategy. Audits, designs, and improves label schemas using cardinality scoring, access-pattern alignment, static vs. dynamic label rules, and consistency checks. Use when the user asks to evaluate, audit, design, or improve a Loki label strategy — or asks why their Loki queries are slow. Not for Prometheus - use grafana-prometheus-label-strategy.","yhyu13\u002FAgentSkillsVault","yhyu13","https:\u002F\u002Favatars.githubusercontent.com\u002Fu\u002F19365678?v=4","01M79A3XCF5M26GEWS60XQQRWW","俞航","01M79A3XD7YZ779GGWS41K367S",3,"Apache-2.0","https:\u002F\u002Fgithub.com\u002Fyhyu13\u002FAgentSkillsVault\u002Fblob\u002Fmain\u002FSKILL\u002Fdevops\u002Ftier1\u002Fgrafana-loki-label-analyzer\u002FSKILL.md",[],[],"2026-11-15 14:19:17",false,"---\nname: grafana-loki-label-analyzer\nlicense: Apache-2.0\ndescription: \"Grafana Loki label schemas only. Expert evaluator for Grafana Loki label strategy. Audits, designs, and improves label schemas using cardinality scoring, access-pattern alignment, static vs. dynamic label rules, and consistency checks. Use when the user asks to evaluate, audit, design, or improve a Loki label strategy — or asks why their Loki queries are slow. Not for Prometheus - use grafana-prometheus-label-strategy.\"\nversion: 1.0.0\n---\n\n# Loki Label Strategy Evaluator\n\nYou are an expert in Grafana Loki label strategy. When asked to evaluate, audit, design, or improve a Loki label strategy — or when a user asks why their Loki queries are slow — use this guide to provide structured, actionable advice.\n\n---\n\n## Core Concepts\n\n**Streams** are the fundamental unit in Loki. Each unique combination of label key-value pairs creates a new stream. Too many streams = performance problems. Too few = broad, slow queries.\n\n**Cardinality** = the number of unique values a label can have. High-cardinality labels (like `pod`, `user_id`, `request_id`) dramatically increase stream count and hurt performance — *especially* when those labels are not specified in every query.\n\n**The dual impact rule**: High-cardinality labels hurt on both paths:\n- **Ingestion path**: More streams → larger index, higher storage costs\n- **Query path**: If a high-cardinality label exists but isn't in the query selector, Loki must scan ALL streams matching the other selectors — catastrophic for performance\n\n**The key question for any dynamic label**: \"Will this label be used in 9 out of 10 queries?\" If no → it should NOT be a label — **except** platform \u002F correlation labels (below).\n\n**Platform \u002F correlation labels are exempt from drop recommendations.** Never recommend dropping `service_name`, `deployment_environment`, or `job` when present. Bad cardinality on those keys is a **value** problem (stabilize identities); dropping the key breaks Grafana Cloud correlation, App O11y, alerts, and dashboards. Load [references\u002Fprotected-labels.md](references\u002Fprotected-labels.md) before any demote\u002F`label_keep` advice.\n\n---\n\n## Label Evaluation Framework\n\nWhen auditing a label strategy, assess each label against these criteria.\n\n### Cardinality Scoring\n\n| Label Example | Cardinality | Verdict |\n|---|---|---|\n| `service_name` \u002F `deployment_environment` \u002F `job` | Any | ✅ Keep key — remediate values if high-card (never drop) |\n| `env` (prod\u002Fstaging\u002Fdev) | 2–5 values | ✅ Good |\n| `level` (info\u002Fwarn\u002Ferror) | 3–6 values | ✅ Good |\n| `namespace` (K8s) | Tens | ✅ Acceptable |\n| `instance` \u002F `hostname` | Hundreds–thousands | ⚠️ Evaluate access patterns |\n| `pod` | Thousands + transient | ⚠️ Demote off index (structured metadata) — migrate selectors first |\n| `user_id`, `request_id` | Unbounded | ❌ Never use as label |\n\n### Access Pattern Alignment\nFor each label, ask:\n- Is this label on the protected allowlist? If yes → Keep key; remediate values only ([protected-labels.md](references\u002Fprotected-labels.md))\n- Is this label used as a selector in most queries targeting these logs?\n- Does this label logically segment data in the way users think about it?\n- Would demoting this label break alerts, dashboards, LBAC, or correlation without a migration plan?\n- Would demoting this label force users to scan dramatically more data?\n\n### Static vs. Dynamic Label Values\n- **Static labels** (values don't change per log line, e.g., `platform=linux`, `job=agent`) add no cardinality cost relative to the query scope. Use freely for LBAC, exploration, and alert routing.\n- **Dynamic labels** (values change per log line) must be bounded. Keep possible values in the single digits or low tens.\n\n### Consistency Check\n- Are label names consistent across services? (case-sensitive — `Level` ≠ `level`)\n- Are label values normalized? (`INFO`, `info`, `Info` should all become `info`)\n- Is there a naming convention? (pick one: `snake_case` or `camelCase` — be consistent)\n\n---\n\n## Evaluation Output Format\n\nWhen auditing a label set, produce a report in the structure below.\n\n**Hard requirements before finalizing any audit report:**\n\n1. **Disclaimer (mandatory, first body section):** Load [references\u002Fdisclaimer.md](references\u002Fdisclaimer.md) and paste its two paragraphs **verbatim** under a `### Disclaimer` heading. An empty Disclaimer heading is a failed report — do not ship the audit until both paragraphs are present. Never paraphrase, summarize, or omit this text.\n2. **Protected labels:** Before recommending demote\u002Fdrop for any label, load [references\u002Fprotected-labels.md](references\u002Fprotected-labels.md). Never recommend dropping `service_name`, `deployment_environment`, or `job` when present — only value remediation. Include a **Downstream dependency check** covering alerts, dashboards, LBAC, and correlation.\n3. **Cost Impact Analysis:** Include when Grafana Cloud usage metrics are available; if they are not, state what is missing and still give qualitative A\u002FB\u002FC guidance. Load [references\u002Fcost-impact.md](references\u002Fcost-impact.md) and follow its **Required report shape** (scenario cards). Do **not** paste markdown tables or panel\u002Fquery JSON into this section.\n\n**Report completion check:** Before delivering, confirm (a) the output contains the substring `Confidential Information of Raintank, Inc.` immediately after `### Disclaimer`, (b) Cost Impact Analysis uses scenario cards (A\u002FB\u002FC) with a **Billing note** opener and a bullet **Measured baseline** — not a scenario table and not `panelId`\u002F`targets` JSON, and (c) no Action cell recommends dropping an allowlisted correlation label. If (a) is missing, paste from [references\u002Fdisclaimer.md](references\u002Fdisclaimer.md) and re-emit. If (b) fails, rewrite Cost Impact from [references\u002Fcost-impact.md](references\u002Fcost-impact.md). If (c) fails, rewrite Actions per [references\u002Fprotected-labels.md](references\u002Fprotected-labels.md).\n\n```\n## Loki Label Strategy Audit\n\n### Disclaimer\n[Paste BOTH paragraphs from references\u002Fdisclaimer.md HERE — never leave this heading empty]\n\n### Summary\n[1-2 sentence overall assessment]\n\n### Downstream dependency check\n[Alerts \u002F dashboards \u002F LBAC \u002F correlation that select on labels proposed for demote or rename — or \"unknown; confirm with customer before cutover\"]\n\n### Label Analysis\n| Label | Cardinality | Used in Queries? | Verdict | Action |\n|---|---|---|---|---|\n| service_name | High (UUID values) | Always | ✅ Keep key | Stabilize values to durable service identity — do not drop label |\n| deployment_environment | Low | Often | ✅ Keep | — |\n| job | Low–medium | Often | ✅ Keep | — |\n| pod | Very High (transient)| Rarely | ⚠️ Demote | Move to structured metadata or embed; migrate selectors first |\n\n### Estimated Impact\n- Stream count reduction: [X streams → Y streams]\n- Query performance: [describe improvement]\n- Storage impact: [if log line changes are involved]\n- Correlation impact: [none if allowlist preserved; call out if aliases need dual-write]\n\n### Cost Impact Analysis\n[Follow references\u002Fcost-impact.md Required report shape — do not invent a table]\n\n**Billing note:** Label hygiene alone does not reduce billable ingest bytes.\nStream count and query cost improve; ingest $ drops only when volume is reduced.\n\n**Measured baseline** (Grafana Cloud usage metrics):\n- Active streams: [N]\n- Billable ingest: [rate]\n- Overage: [units or $]\n- Top ingest contributor: [name + rate] (omit if unavailable)\n\n**Scenario A — Label hygiene only (this audit)**\n- Actions \u002F stream impact \u002F volume=$0 \u002F overage unchanged\n\n**Scenario B — A + approved debug\u002Ftrace drop**\n- Actions \u002F volume % \u002F $ or overage estimate \u002F customer-approval guardrail\n\n**Scenario C — B + log-line compaction**\n- Actions \u002F additional volume % \u002F highest-value target\n\n**Attribution gap:** [...]\n**Caveats:** [...]\n\n### Recommended Label Set\n[Final recommended labels — must include service_name, deployment_environment, job when present]\n\n### Migration Notes\n[How to implement changes via Alloy\u002FAgent pipeline stages; dual-write \u002F selector updates for any demote or rename]\n```\n\n---\n\n## Recommended Common Labels\n\nEvery log source should consider these base labels — all low cardinality, high query value:\n\n| Label | Purpose |\n|---|---|\n| `service_name` | Identifying the generating application (OTel `service.name` — **required for Grafana Cloud correlation \u002F App O11y**) |\n| `deployment_environment` | Deployment environment (OTel `deployment.environment`) — keep when present |\n| `job` | Collector \u002F OTel job (`namespace\u002Fservice.name` pattern common on span metrics) — keep when present |\n| `app` \u002F `service` | Legacy aliases only — prefer aligning to `service_name`; do not delete without a migration plan |\n| `env` | Environment shorthand (prod, staging, dev) when `deployment_environment` is absent |\n| `cluster` | Multi-cluster differentiation |\n| `region` | Geographic region |\n| `level` | Log severity — normalize to: `info`, `warn`, `error`, `debug` |\n| `team` \u002F `squad` | Ownership (also useful for LBAC) |\n| `source` | Log origin type (`file`, `k8s-events`, `journal`, `syslog`, etc.) |\n| `classification` | Data sensitivity level — for LBAC policies |\n\nAlways include allowlisted correlation labels in any `label_keep` list — see [references\u002Fprotected-labels.md](references\u002Fprotected-labels.md).\n\n---\n\n## Kubernetes Pod Logs\n\n### Recommended Labels\n\n| Label | Description |\n|---|---|\n| `service_name` | Stable service identity (OTel `service.name`) — **keep**; remediate UUID\u002Fephemeral values |\n| `namespace` | K8s namespace — delineates isolation boundaries |\n| `container` | Container name — low cardinality, differentiates log formats |\n| `workload` | `{controller_kind}\u002F{controller_name}` e.g. `ReplicaSet\u002Fpayment-api` — **strongly recommended** |\n\n**Why `workload` beats `app` for K8s**: Derived from `{{controller_kind}}\u002F{{controller_name}}` — static values that never change like pod names do. Unlike `app` (which may aggregate multiple workload types), `workload` is precise and predictable. Users always know exactly what value to query. Still keep `service_name` for cross-signal correlation even when using `workload`.\n\n### Labels to demote in Kubernetes (not \"never existed\")\n\n**`pod` label** ⚠️\n- Highly transient: pod names change on every restart\u002Frollout\n- Very high cardinality: 5 pods × 2 containers = 10 streams; add `pod` → 10 × N streams\n- Users almost never query for a specific pod; they query for the *workload*\n- **Solution**: Use `workload` as the index label; store `pod` in structured metadata or embed in the log line. Migrate any alerts\u002Fdashboards that select on `pod` before demoting.\n\n**`filename` label (raw K8s path)** ⚠️\n- K8s log paths contain pod UID: `\u002Fvar\u002Flog\u002Fpods\u002F{namespace}_{pod}_{pod_id}\u002F{container}\u002F{rotation}.log`\n- The `pod_id` component makes this unbounded\n- **Solution**: Normalize to `\u002Fvar\u002Flog\u002Fpods\u002F{namespace}\u002F{controller_name}\u002F{container}.log` or demote entirely after checking selectors\n\n```alloy\n\u002F\u002F Normalize K8s filename to remove pod UID\nstage.replace {\n source = \"filename\"\n expression = \"\u002Fvar\u002Flog\u002Fpods\u002F([^\u002F]+)_[^_]+_[^\u002F]+\u002F([^\u002F]+)\u002F\\\\d+\\\\.log\"\n replace = \"\u002Fvar\u002Flog\u002Fpods\u002F$1\u002F$2\u002Fcurrent.log\"\n}\n```\n\n---\n\n## Host \u002F VM \u002F Bare Metal Labels\n\nIn addition to common labels, add:\n\n| Label | Description | Notes |\n|---|---|---|\n| `instance` | Hostname of the machine | Cardinality = number of machines; acceptable for fixed infrastructure |\n| `filename` | Full path to the file being tailed | Normalize rotating filenames — strip date suffixes |\n\n```alloy\n\u002F\u002F Remove date suffixes from rotating log file names\n\u002F\u002F \u002Fvar\u002Flog\u002Fmyapp\u002Flogfile-20230927.txt → \u002Fvar\u002Flog\u002Fmyapp\u002Flogfile.txt\nstage.replace {\n source = \"filename\"\n expression = \"-\\\\d{8}(\\\\.log|\\\\.txt)$\"\n replace = \"$1\"\n}\n```\n\n---\n\n## Journal Logs\n\nWhen collecting via `loki.source.journal`, many labels are auto-discovered under `__journal__*`:\n`boot_id`, `cap_effective`, `cmdline`, `comm`, `exe`, `gid`, `hostname`, `machine_id`, `pid`, `stream_id`, `systemd_cgroup`, `systemd_invocation_id`, `systemd_slice`, `systemd_unit`, `transport`, `uid`\n\nAlmost all are high-cardinality. **Keep** `instance` (hostname) and `unit` (`systemd_unit`, e.g. `nginx.service`), plus any allowlisted correlation labels present on the stream (`service_name`, `deployment_environment`, `job`).\n\nDrop other non-allowlisted high-cardinality journal labels (not platform keys):\n```alloy\nloki.process \"journal_labels\" {\n forward_to = [...]\n stage.label_keep {\n values = [\"instance\", \"unit\", \"env\", \"cluster\", \"service_name\", \"deployment_environment\", \"job\"]\n }\n}\n```\n\n---\n\n## Structured Metadata\n\nStructured metadata attaches key-value pairs to log entries *without* making them index labels. The ideal home for high-cardinality values users occasionally need.\n\n**Requires**: Loki 2.9+, Grafana Agent\u002FAlloy. Enable via `limits_config`:\n```yaml\nlimits_config:\n allow_structured_metadata: true\n```\n\n**Good candidates for structured metadata** (not labels):\n- `pod` — K8s pod name\n- `node` — K8s worker node\n- `version` \u002F `image` \u002F `tag`\n- `trace_id` \u002F `user_id`\n- `process_id`\n- `restarted` — pod restart timestamp\n\nQuery structured metadata at query time without a parser:\n```logql\n{service_name=\"payment-api\"} | pod=\"payment-api-7f9d4b-xk2r9\"\n```\n\n---\n\n## Embedding Metadata in Log Lines\n\nWhen structured metadata isn't available, embed high-cardinality values into the log line rather than using them as labels.\n\n### Method 1: stage.template (append to log line)\n\n```alloy\nloki.process \"embed_pod\" {\n forward_to = [...]\n\n \u002F\u002F For JSON logs\n stage.match {\n selector = \"{} |~ \\\"^\\\\s*\\\\{\\\"\"\n stage.replace {\n expression = \"\\\\}$\"\n replace = \"\"\n }\n stage.template {\n source = \"log_line\"\n template = \"{{ .Entry }},\\\"_pod\\\":\\\"{{ .pod }}\\\"}\"\n }\n }\n\n \u002F\u002F For text logs\n stage.match {\n selector = \"{} !~ \\\"^\\\\s*\\\\{\\\"\"\n stage.template {\n source = \"log_line\"\n template = \"{{ .Entry }} _pod={{ .pod }}\"\n }\n }\n\n stage.output { source = \"log_line\" }\n}\n```\n\nResult: `ts=... msg=\"...\" _pod=agent-logs-cqhfk`\n\nQuery by aggregate (normal use):\n```logql\nsum(count_over_time({workload=\"ReplicaSet\u002Fpayment-api\", level=\"error\"}[1m]))\n```\n\nQuery a specific pod (edge case debugging):\n```logql\n{workload=\"ReplicaSet\u002Fpayment-api\", level=\"error\"} |= `_pod=payment-api-3`\n```\n\n### Method 2: stage.pack (JSON envelope)\n\n```alloy\nloki.process \"pack_pod\" {\n forward_to = [...]\n stage.pack {\n labels = [\"pod\"]\n ingest_timestamp = false\n }\n}\n```\n\nPacked result: `{\"_entry\": \"original log line\", \"pod\": \"agent-logs-cqhfk\"}`\n\nUnpack at query time:\n```logql\n{workload=\"ReplicaSet\u002Fpayment-api\", level=\"error\"}\n |= `agent-logs-cqhfk`\n | unpack\n```\n\n---\n\n## Performance Bottleneck Diagnosis\n\nWhen a user reports slow queries, identify where time is spent using Querier `metrics.go` logs.\n\n### Four Query Stages\n\n| Stage | Metric | High Value Means | Fix |\n|---|---|---|---|\n| Queue | `queue_time` | Not enough Queriers | Add Queriers or reduce parallelism |\n| Index | `chunk_refs_fetch_time` | Need more Index Gateway instances | Scale index-gateways; check CPU |\n| Storage | `store_chunks_download_time` | Chunks too small OR storage bottleneck | Check avg chunk size: `total_bytes \u002F cache_chunk_req` |\n| Execution | `duration - chunk_refs_fetch_time - store_chunks_download_time` | CPU-intensive regex, or too many tiny log lines | Reduce regex; add CPU; increase parallelism |\n\n**Ideally, the majority of time is spent in Execution.** If not, that indicates infrastructure or label design problems.\n\n### Checking Chunk Size\n```\navg chunk size = total_bytes \u002F cache_chunk_req\n```\nIf the result is a few hundred bytes or kilobytes (instead of megabytes), chunks are too small. This means labels are over-splitting data into too many streams. Revisit cardinality — demote non-allowlisted high-card labels or stabilize protected-label values.\n\n### Common Label-Related Performance Problems\n\n**Problem: Query scans too many streams**\n- Cause: High-cardinality labels exist but aren't specified in the query selector\n- Fix: Demote the label off the index after a migration check, or ensure queries always include it as a filter. Never demote allowlisted correlation labels — stabilize their values instead ([protected-labels.md](references\u002Fprotected-labels.md))\n\n**Problem: High `post_filter_lines` discard ratio** (`post_filter_lines \u003C\u003C total_lines`)\n- Cause: Insufficient label selectivity; query scans and discards most logs\n- Fix: Add labels matching user access patterns (`level`, `workload`, `container`, `service_name`)\n\n**Problem: Small chunks**\n- Cause: Too many labels creating too many fine-grained streams\n- Fix: Demote high-cardinality non-allowlisted labels (e.g. `pod`) to consolidate streams; remediate protected-label *values* if they are the splitter\n\n### Query Optimization Quick Wins\n1. Add `container` or `workload` to narrow scope before line filters\n2. Add `level` label + always use it in queries (filters out 94%+ of logs when searching for errors)\n3. Demote `pod` off the index → reduces stream count by ~5× in typical K8s deployments (migrate selectors first)\n4. Replace regex line filters (`|~`) with exact filters (`|=`) where possible\n5. Keep `service_name` (and peers); if values are UUIDs\u002Fephemeral, normalize to a stable identity — do not drop the key\n\n---\n\n## Alloy \u002F Agent Configuration Patterns\n\n### Normalize Log Level\n\n```alloy\nloki.process \"normalize_level\" {\n forward_to = [...]\n stage.replace { source = \"level\"; expression = \"(?i)I(nfo)?\"; replace = \"info\" }\n stage.replace { source = \"level\"; expression = \"(?i)W(arn(ing)?)?\"; replace = \"warn\" }\n stage.replace { source = \"level\"; expression = \"(?i)E(rr(or)?)?\"; replace = \"error\" }\n stage.replace { source = \"level\"; expression = \"(?i)D(ebug?)?\"; replace = \"debug\" }\n stage.labels { values = { level = \"\" } }\n}\n```\n\n### Conditional Meta-Label Extraction\n\n```alloy\n\u002F\u002F Only extract when the relevant field is present — avoids unnecessary cardinality\nloki.process \"conditional_extraction\" {\n forward_to = [...]\n stage.match {\n selector = \"{app=\\\"loki\\\"} |= \\\"component\\\"\"\n stage.logfmt { mapping = { \"component\" = \"\" } }\n stage.labels { values = { component = \"\" } }\n }\n}\n```\n\n### Enforce Approved Label Set (always use as final stage)\n\nAlways include allowlisted correlation labels when present — never omit `service_name`, `deployment_environment`, or `job` from `label_keep` ([protected-labels.md](references\u002Fprotected-labels.md)):\n\n```alloy\nloki.process \"enforce_labels\" {\n forward_to = [loki.write.default.receiver]\n \u002F\u002F ... other stages ...\n stage.label_keep {\n values = [\n \"service_name\", \"deployment_environment\", \"job\",\n \"env\", \"cluster\", \"level\", \"namespace\", \"workload\", \"container\",\n ]\n }\n}\n```\n\n### Soft Enforcement (inject \"unknown\" for missing labels)\n\n```alloy\nstage.template {\n source = \"team\"\n template = \"{{ if .Value }}{{ .Value }}{{ else }}unknown{{ end }}\"\n}\nstage.labels { values = { team = \"\" } }\n```\n\n---\n\n## Log Line Optimization\n\nByte-level reductions (timestamps, ANSI, null JSON fields) for Scenario C savings — see [references\u002Flog-line-optimization.md](references\u002Flog-line-optimization.md).\n\n---\n\n## Security & LBAC\n\nGrafana Enterprise Logs (GEL) supports Label-Based Access Control (LBAC). Any label can serve as an access control selector.\n\n**Best labels for LBAC**:\n- `classification` — data sensitivity (`public`, `restricted`, `confidential`, `top-secret`)\n- `source` — controls which teams can see which log origins\n- `team` \u002F `squad` — ownership-based access\n- `env` — environment-level restrictions\n\nStatic aggregate labels like `owner=sysadmins` or `category=database` are particularly effective: one label value gates access to many log files, rather than requiring a long allowlist of filenames or streams.\n\n---\n\n## The 80\u002F20 Rule\n\nThe most impactful improvements almost always come from these four changes:\n\n1. **Demote `pod` off the index** (structured metadata) — biggest stream reduction in K8s; migrate selectors first\n2. **Add `level` as a label AND always specify it in queries** — can eliminate 94%+ of scanned data when searching for errors\n3. **Normalize label values** — eliminates phantom duplicate streams from inconsistent casing; for `service_name`, stabilize UUID\u002Fephemeral values (never drop the key)\n4. **Normalize or demote `filename`** in K8s — highly variable paths inflate stream count significantly\n\nFocus on these before anything else. Never \"fix\" cardinality by dropping `service_name`, `deployment_environment`, or `job`.\n\n---\n\n## Labels to Avoid — Quick Reference\n\n| Label | Why | Alternative |\n|---|---|---|\n| `pod` | Transient, high card | Demote: `workload` label + `pod` in structured metadata (migrate selectors) |\n| `user_id` | Unbounded — never valid as index label | Keep only in log content |\n| `request_id` \u002F `trace_id` | Unbounded — never valid as index label | Structured metadata |\n| `filename` (raw K8s path) | Contains pod UID | Normalize or demote after selector check |\n| Unnormalized `level` | `INFO`\u002F`info`\u002F`Info` = 3 streams | Normalize at collection time |\n| UUID \u002F ephemeral `service_name` *values* | Inflates streams; key is still required | Keep key; map values to stable service identity |\n| Any dynamically-named label key | Cannot be bounded | Use fixed keys with bounded values |\n\n**Never drop:** `service_name`, `deployment_environment`, `job` — see [references\u002Fprotected-labels.md](references\u002Fprotected-labels.md).\n\n---\n\n## Cost Impact Analysis\n\nLabel hygiene alone does not cut billable ingest bytes ($0 direct). Volume savings come from enabled `stage.drop` \u002F log-line cleanup. Load [references\u002Fcost-impact.md](references\u002Fcost-impact.md) when writing the report section: use its scenario-card shape, cite scalar metrics (optional short panel ID \u002F PromQL), and never paste the agent-only reference table or panel JSON into the customer report.\n","# Loki Label Strategy Evaluator\n\nYou are an expert in Grafana Loki label strategy. When asked to evaluate, audit, design, or improve a Loki label strategy — or when a user asks why their Loki queries are slow — use this guide to provide structured, actionable advice.\n\n---\n\n## Core Concepts\n\n**Streams** are the fundamental unit in Loki. Each unique combination of label key-value pairs creates a new stream. Too many streams = performance problems. Too few = broad, slow queries.\n\n**Cardinality** = the number of unique values a label can have. High-cardinality labels (like `pod`, `user_id`, `request_id`) dramatically increase stream count and hurt performance — *especially* when those labels are not specified in every query.\n\n**The dual impact rule**: High-cardinality labels hurt on both paths:\n- **Ingestion path**: More streams → larger index, higher storage costs\n- **Query path**: If a high-cardinality label exists but isn't in the query selector, Loki must scan ALL streams matching the other selectors — catastrophic for performance\n\n**The key question for any dynamic label**: \"Will this label be used in 9 out of 10 queries?\" If no → it should NOT be a label — **except** platform \u002F correlation labels (below).\n\n**Platform \u002F correlation labels are exempt from drop recommendations.** Never recommend dropping `service_name`, `deployment_environment`, or `job` when present. Bad cardinality on those keys is a **value** problem (stabilize identities); dropping the key breaks Grafana Cloud correlation, App O11y, alerts, and dashboards. Load [references\u002Fprotected-labels.md](references\u002Fprotected-labels.md) before any demote\u002F`label_keep` advice.\n\n---\n\n## Label Evaluation Framework\n\nWhen auditing a label strategy, assess each label against these criteria.\n\n### Cardinality Scoring\n\n| Label Example | Cardinality | Verdict |\n|---|---|---|\n| `service_name` \u002F `deployment_environment` \u002F `job` | Any | ✅ Keep key — remediate values if high-card (never drop) |\n| `env` (prod\u002Fstaging\u002Fdev) | 2–5 values | ✅ Good |\n| `level` (info\u002Fwarn\u002Ferror) | 3–6 values | ✅ Good |\n| `namespace` (K8s) | Tens | ✅ Acceptable |\n| `instance` \u002F `hostname` | Hundreds–thousands | ⚠️ Evaluate access patterns |\n| `pod` | Thousands + transient | ⚠️ Demote off index (structured metadata) — migrate selectors first |\n| `user_id`, `request_id` | Unbounded | ❌ Never use as label |\n\n### Access Pattern Alignment\nFor each label, ask:\n- Is this label on the protected allowlist? If yes → Keep key; remediate values only ([protected-labels.md](references\u002Fprotected-labels.md))\n- Is this label used as a selector in most queries targeting these logs?\n- Does this label logically segment data in the way users think about it?\n- Would demoting this label break alerts, dashboards, LBAC, or correlation without a migration plan?\n- Would demoting this label force users to scan dramatically more data?\n\n### Static vs. Dynamic Label Values\n- **Static labels** (values don't change per log line, e.g., `platform=linux`, `job=agent`) add no cardinality cost relative to the query scope. Use freely for LBAC, exploration, and alert routing.\n- **Dynamic labels** (values change per log line) must be bounded. Keep possible values in the single digits or low tens.\n\n### Consistency Check\n- Are label names consistent across services? (case-sensitive — `Level` ≠ `level`)\n- Are label values normalized? (`INFO`, `info`, `Info` should all become `info`)\n- Is there a naming convention? (pick one: `snake_case` or `camelCase` — be consistent)\n\n---\n\n## Evaluation Output Format\n\nWhen auditing a label set, produce a report in the structure below.\n\n**Hard requirements before finalizing any audit report:**\n\n1. **Disclaimer (mandatory, first body section):** Load [references\u002Fdisclaimer.md](references\u002Fdisclaimer.md) and paste its two paragraphs **verbatim** under a `### Disclaimer` heading. An empty Disclaimer heading is a failed report — do not ship the audit until both paragraphs are present. Never paraphrase, summarize, or omit this text.\n2. **Protected labels:** Before recommending demote\u002Fdrop for any label, load [references\u002Fprotected-labels.md](references\u002Fprotected-labels.md). Never recommend dropping `service_name`, `deployment_environment`, or `job` when present — only value remediation. Include a **Downstream dependency check** covering alerts, dashboards, LBAC, and correlation.\n3. **Cost Impact Analysis:** Include when Grafana Cloud usage metrics are available; if they are not, state what is missing and still give qualitative A\u002FB\u002FC guidance. Load [references\u002Fcost-impact.md](references\u002Fcost-impact.md) and follow its **Required report shape** (scenario cards). Do **not** paste markdown tables or panel\u002Fquery JSON into this section.\n\n**Report completion check:** Before delivering, confirm (a) the output contains the substring `Confidential Information of Raintank, Inc.` immediately after `### Disclaimer`, (b) Cost Impact Analysis uses scenario cards (A\u002FB\u002FC) with a **Billing note** opener and a bullet **Measured baseline** — not a scenario table and not `panelId`\u002F`targets` JSON, and (c) no Action cell recommends dropping an allowlisted correlation label. If (a) is missing, paste from [references\u002Fdisclaimer.md](references\u002Fdisclaimer.md) and re-emit. If (b) fails, rewrite Cost Impact from [references\u002Fcost-impact.md](references\u002Fcost-impact.md). If (c) fails, rewrite Actions per [references\u002Fprotected-labels.md](references\u002Fprotected-labels.md).\n\n```\n## Loki Label Strategy Audit\n\n### Disclaimer\n[Paste BOTH paragraphs from references\u002Fdisclaimer.md HERE — never leave this heading empty]\n\n### Summary\n[1-2 sentence overall assessment]\n\n### Downstream dependency check\n[Alerts \u002F dashboards \u002F LBAC \u002F correlation that select on labels proposed for demote or rename — or \"unknown; confirm with customer before cutover\"]\n\n### Label Analysis\n| Label | Cardinality | Used in Queries? | Verdict | Action |\n|---|---|---|---|---|\n| service_name | High (UUID values) | Always | ✅ Keep key | Stabilize values to durable service identity — do not drop label |\n| deployment_environment | Low | Often | ✅ Keep | — |\n| job | Low–medium | Often | ✅ Keep | — |\n| pod | Very High (transient)| Rarely | ⚠️ Demote | Move to structured metadata or embed; migrate selectors first |\n\n### Estimated Impact\n- Stream count reduction: [X streams → Y streams]\n- Query performance: [describe improvement]\n- Storage impact: [if log line changes are involved]\n- Correlation impact: [none if allowlist preserved; call out if aliases need dual-write]\n\n### Cost Impact Analysis\n[Follow references\u002Fcost-impact.md Required report shape — do not invent a table]\n\n**Billing note:** Label hygiene alone does not reduce billable ingest bytes.\nStream count and query cost improve; ingest $ drops only when volume is reduced.\n\n**Measured baseline** (Grafana Cloud usage metrics):\n- Active streams: [N]\n- Billable ingest: [rate]\n- Overage: [units or $]\n- Top ingest contributor: [name + rate] (omit if unavailable)\n\n**Scenario A — Label hygiene only (this audit)**\n- Actions \u002F stream impact \u002F volume=$0 \u002F overage unchanged\n\n**Scenario B — A + approved debug\u002Ftrace drop**\n- Actions \u002F volume % \u002F $ or overage estimate \u002F customer-approval guardrail\n\n**Scenario C — B + log-line compaction**\n- Actions \u002F additional volume % \u002F highest-value target\n\n**Attribution gap:** [...]\n**Caveats:** [...]\n\n### Recommended Label Set\n[Final recommended labels — must include service_name, deployment_environment, job when present]\n\n### Migration Notes\n[How to implement changes via Alloy\u002FAgent pipeline stages; dual-write \u002F selector updates for any demote or rename]\n```\n\n---\n\n## Recommended Common Labels\n\nEvery log source should consider these base labels — all low cardinality, high query value:\n\n| Label | Purpose |\n|---|---|\n| `service_name` | Identifying the generating application (OTel `service.name` — **required for Grafana Cloud correlation \u002F App O11y**) |\n| `deployment_environment` | Deployment environment (OTel `deployment.environment`) — keep when present |\n| `job` | Collector \u002F OTel job (`namespace\u002Fservice.name` pattern common on span metrics) — keep when present |\n| `app` \u002F `service` | Legacy aliases only — prefer aligning to `service_name`; do not delete without a migration plan |\n| `env` | Environment shorthand (prod, staging, dev) when `deployment_environment` is absent |\n| `cluster` | Multi-cluster differentiation |\n| `region` | Geographic region |\n| `level` | Log severity — normalize to: `info`, `warn`, `error`, `debug` |\n| `team` \u002F `squad` | Ownership (also useful for LBAC) |\n| `source` | Log origin type (`file`, `k8s-events`, `journal`, `syslog`, etc.) |\n| `classification` | Data sensitivity level — for LBAC policies |\n\nAlways include allowlisted correlation labels in any `label_keep` list — see [references\u002Fprotected-labels.md](references\u002Fprotected-labels.md).\n\n---\n\n## Kubernetes Pod Logs\n\n### Recommended Labels\n\n| Label | Description |\n|---|---|\n| `service_name` | Stable service identity (OTel `service.name`) — **keep**; remediate UUID\u002Fephemeral values |\n| `namespace` | K8s namespace — delineates isolation boundaries |\n| `container` | Container name — low cardinality, differentiates log formats |\n| `workload` | `{controller_kind}\u002F{controller_name}` e.g. `ReplicaSet\u002Fpayment-api` — **strongly recommended** |\n\n**Why `workload` beats `app` for K8s**: Derived from `{{controller_kind}}\u002F{{controller_name}}` — static values that never change like pod names do. Unlike `app` (which may aggregate multiple workload types), `workload` is precise and predictable. Users always know exactly what value to query. Still keep `service_name` for cross-signal correlation even when using `workload`.\n\n### Labels to demote in Kubernetes (not \"never existed\")\n\n**`pod` label** ⚠️\n- Highly transient: pod names change on every restart\u002Frollout\n- Very high cardinality: 5 pods × 2 containers = 10 streams; add `pod` → 10 × N streams\n- Users almost never query for a specific pod; they query for the *workload*\n- **Solution**: Use `workload` as the index label; store `pod` in structured metadata or embed in the log line. Migrate any alerts\u002Fdashboards that select on `pod` before demoting.\n\n**`filename` label (raw K8s path)** ⚠️\n- K8s log paths contain pod UID: `\u002Fvar\u002Flog\u002Fpods\u002F{namespace}_{pod}_{pod_id}\u002F{container}\u002F{rotation}.log`\n- The `pod_id` component makes this unbounded\n- **Solution**: Normalize to `\u002Fvar\u002Flog\u002Fpods\u002F{namespace}\u002F{controller_name}\u002F{container}.log` or demote entirely after checking selectors\n\n```alloy\n\u002F\u002F Normalize K8s filename to remove pod UID\nstage.replace {\n source = \"filename\"\n expression = \"\u002Fvar\u002Flog\u002Fpods\u002F([^\u002F]+)_[^_]+_[^\u002F]+\u002F([^\u002F]+)\u002F\\\\d+\\\\.log\"\n replace = \"\u002Fvar\u002Flog\u002Fpods\u002F$1\u002F$2\u002Fcurrent.log\"\n}\n```\n\n---\n\n## Host \u002F VM \u002F Bare Metal Labels\n\nIn addition to common labels, add:\n\n| Label | Description | Notes |\n|---|---|---|\n| `instance` | Hostname of the machine | Cardinality = number of machines; acceptable for fixed infrastructure |\n| `filename` | Full path to the file being tailed | Normalize rotating filenames — strip date suffixes |\n\n```alloy\n\u002F\u002F Remove date suffixes from rotating log file names\n\u002F\u002F \u002Fvar\u002Flog\u002Fmyapp\u002Flogfile-20230927.txt → \u002Fvar\u002Flog\u002Fmyapp\u002Flogfile.txt\nstage.replace {\n source = \"filename\"\n expression = \"-\\\\d{8}(\\\\.log|\\\\.txt)$\"\n replace = \"$1\"\n}\n```\n\n---\n\n## Journal Logs\n\nWhen collecting via `loki.source.journal`, many labels are auto-discovered under `__journal__*`:\n`boot_id`, `cap_effective`, `cmdline`, `comm`, `exe`, `gid`, `hostname`, `machine_id`, `pid`, `stream_id`, `systemd_cgroup`, `systemd_invocation_id`, `systemd_slice`, `systemd_unit`, `transport`, `uid`\n\nAlmost all are high-cardinality. **Keep** `instance` (hostname) and `unit` (`systemd_unit`, e.g. `nginx.service`), plus any allowlisted correlation labels present on the stream (`service_name`, `deployment_environment`, `job`).\n\nDrop other non-allowlisted high-cardinality journal labels (not platform keys):\n```alloy\nloki.process \"journal_labels\" {\n forward_to = [...]\n stage.label_keep {\n values = [\"instance\", \"unit\", \"env\", \"cluster\", \"service_name\", \"deployment_environment\", \"job\"]\n }\n}\n```\n\n---\n\n## Structured Metadata\n\nStructured metadata attaches key-value pairs to log entries *without* making them index labels. The ideal home for high-cardinality values users occasionally need.\n\n**Requires**: Loki 2.9+, Grafana Agent\u002FAlloy. Enable via `limits_config`:\n```yaml\nlimits_config:\n allow_structured_metadata: true\n```\n\n**Good candidates for structured metadata** (not labels):\n- `pod` — K8s pod name\n- `node` — K8s worker node\n- `version` \u002F `image` \u002F `tag`\n- `trace_id` \u002F `user_id`\n- `process_id`\n- `restarted` — pod restart timestamp\n\nQuery structured metadata at query time without a parser:\n```logql\n{service_name=\"payment-api\"} | pod=\"payment-api-7f9d4b-xk2r9\"\n```\n\n---\n\n## Embedding Metadata in Log Lines\n\nWhen structured metadata isn't available, embed high-cardinality values into the log line rather than using them as labels.\n\n### Method 1: stage.template (append to log line)\n\n```alloy\nloki.process \"embed_pod\" {\n forward_to = [...]\n\n \u002F\u002F For JSON logs\n stage.match {\n selector = \"{} |~ \\\"^\\\\s*\\\\{\\\"\"\n stage.replace {\n expression = \"\\\\}$\"\n replace = \"\"\n }\n stage.template {\n source = \"log_line\"\n template = \"{{ .Entry }},\\\"_pod\\\":\\\"{{ .pod }}\\\"}\"\n }\n }\n\n \u002F\u002F For text logs\n stage.match {\n selector = \"{} !~ \\\"^\\\\s*\\\\{\\\"\"\n stage.template {\n source = \"log_line\"\n template = \"{{ .Entry }} _pod={{ .pod }}\"\n }\n }\n\n stage.output { source = \"log_line\" }\n}\n```\n\nResult: `ts=... msg=\"...\" _pod=agent-logs-cqhfk`\n\nQuery by aggregate (normal use):\n```logql\nsum(count_over_time({workload=\"ReplicaSet\u002Fpayment-api\", level=\"error\"}[1m]))\n```\n\nQuery a specific pod (edge case debugging):\n```logql\n{workload=\"ReplicaSet\u002Fpayment-api\", level=\"error\"} |= `_pod=payment-api-3`\n```\n\n### Method 2: stage.pack (JSON envelope)\n\n```alloy\nloki.process \"pack_pod\" {\n forward_to = [...]\n stage.pack {\n labels = [\"pod\"]\n ingest_timestamp = false\n }\n}\n```\n\nPacked result: `{\"_entry\": \"original log line\", \"pod\": \"agent-logs-cqhfk\"}`\n\nUnpack at query time:\n```logql\n{workload=\"ReplicaSet\u002Fpayment-api\", level=\"error\"}\n |= `agent-logs-cqhfk`\n | unpack\n```\n\n---\n\n## Performance Bottleneck Diagnosis\n\nWhen a user reports slow queries, identify where time is spent using Querier `metrics.go` logs.\n\n### Four Query Stages\n\n| Stage | Metric | High Value Means | Fix |\n|---|---|---|---|\n| Queue | `queue_time` | Not enough Queriers | Add Queriers or reduce parallelism |\n| Index | `chunk_refs_fetch_time` | Need more Index Gateway instances | Scale index-gateways; check CPU |\n| Storage | `store_chunks_download_time` | Chunks too small OR storage bottleneck | Check avg chunk size: `total_bytes \u002F cache_chunk_req` |\n| Execution | `duration - chunk_refs_fetch_time - store_chunks_download_time` | CPU-intensive regex, or too many tiny log lines | Reduce regex; add CPU; increase parallelism |\n\n**Ideally, the majority of time is spent in Execution.** If not, that indicates infrastructure or label design problems.\n\n### Checking Chunk Size\n```\navg chunk size = total_bytes \u002F cache_chunk_req\n```\nIf the result is a few hundred bytes or kilobytes (instead of megabytes), chunks are too small. This means labels are over-splitting data into too many streams. Revisit cardinality — demote non-allowlisted high-card labels or stabilize protected-label values.\n\n### Common Label-Related Performance Problems\n\n**Problem: Query scans too many streams**\n- Cause: High-cardinality labels exist but aren't specified in the query selector\n- Fix: Demote the label off the index after a migration check, or ensure queries always include it as a filter. Never demote allowlisted correlation labels — stabilize their values instead ([protected-labels.md](references\u002Fprotected-labels.md))\n\n**Problem: High `post_filter_lines` discard ratio** (`post_filter_lines \u003C\u003C total_lines`)\n- Cause: Insufficient label selectivity; query scans and discards most logs\n- Fix: Add labels matching user access patterns (`level`, `workload`, `container`, `service_name`)\n\n**Problem: Small chunks**\n- Cause: Too many labels creating too many fine-grained streams\n- Fix: Demote high-cardinality non-allowlisted labels (e.g. `pod`) to consolidate streams; remediate protected-label *values* if they are the splitter\n\n### Query Optimization Quick Wins\n1. Add `container` or `workload` to narrow scope before line filters\n2. Add `level` label + always use it in queries (filters out 94%+ of logs when searching for errors)\n3. Demote `pod` off the index → reduces stream count by ~5× in typical K8s deployments (migrate selectors first)\n4. Replace regex line filters (`|~`) with exact filters (`|=`) where possible\n5. Keep `service_name` (and peers); if values are UUIDs\u002Fephemeral, normalize to a stable identity — do not drop the key\n\n---\n\n## Alloy \u002F Agent Configuration Patterns\n\n### Normalize Log Level\n\n```alloy\nloki.process \"normalize_level\" {\n forward_to = [...]\n stage.replace { source = \"level\"; expression = \"(?i)I(nfo)?\"; replace = \"info\" }\n stage.replace { source = \"level\"; expression = \"(?i)W(arn(ing)?)?\"; replace = \"warn\" }\n stage.replace { source = \"level\"; expression = \"(?i)E(rr(or)?)?\"; replace = \"error\" }\n stage.replace { source = \"level\"; expression = \"(?i)D(ebug?)?\"; replace = \"debug\" }\n stage.labels { values = { level = \"\" } }\n}\n```\n\n### Conditional Meta-Label Extraction\n\n```alloy\n\u002F\u002F Only extract when the relevant field is present — avoids unnecessary cardinality\nloki.process \"conditional_extraction\" {\n forward_to = [...]\n stage.match {\n selector = \"{app=\\\"loki\\\"} |= \\\"component\\\"\"\n stage.logfmt { mapping = { \"component\" = \"\" } }\n stage.labels { values = { component = \"\" } }\n }\n}\n```\n\n### Enforce Approved Label Set (always use as final stage)\n\nAlways include allowlisted correlation labels when present — never omit `service_name`, `deployment_environment`, or `job` from `label_keep` ([protected-labels.md](references\u002Fprotected-labels.md)):\n\n```alloy\nloki.process \"enforce_labels\" {\n forward_to = [loki.write.default.receiver]\n \u002F\u002F ... other stages ...\n stage.label_keep {\n values = [\n \"service_name\", \"deployment_environment\", \"job\",\n \"env\", \"cluster\", \"level\", \"namespace\", \"workload\", \"container\",\n ]\n }\n}\n```\n\n### Soft Enforcement (inject \"unknown\" for missing labels)\n\n```alloy\nstage.template {\n source = \"team\"\n template = \"{{ if .Value }}{{ .Value }}{{ else }}unknown{{ end }}\"\n}\nstage.labels { values = { team = \"\" } }\n```\n\n---\n\n## Log Line Optimization\n\nByte-level reductions (timestamps, ANSI, null JSON fields) for Scenario C savings — see [references\u002Flog-line-optimization.md](references\u002Flog-line-optimization.md).\n\n---\n\n## Security & LBAC\n\nGrafana Enterprise Logs (GEL) supports Label-Based Access Control (LBAC). Any label can serve as an access control selector.\n\n**Best labels for LBAC**:\n- `classification` — data sensitivity (`public`, `restricted`, `confidential`, `top-secret`)\n- `source` — controls which teams can see which log origins\n- `team` \u002F `squad` — ownership-based access\n- `env` — environment-level restrictions\n\nStatic aggregate labels like `owner=sysadmins` or `category=database` are particularly effective: one label value gates access to many log files, rather than requiring a long allowlist of filenames or streams.\n\n---\n\n## The 80\u002F20 Rule\n\nThe most impactful improvements almost always come from these four changes:\n\n1. **Demote `pod` off the index** (structured metadata) — biggest stream reduction in K8s; migrate selectors first\n2. **Add `level` as a label AND always specify it in queries** — can eliminate 94%+ of scanned data when searching for errors\n3. **Normalize label values** — eliminates phantom duplicate streams from inconsistent casing; for `service_name`, stabilize UUID\u002Fephemeral values (never drop the key)\n4. **Normalize or demote `filename`** in K8s — highly variable paths inflate stream count significantly\n\nFocus on these before anything else. Never \"fix\" cardinality by dropping `service_name`, `deployment_environment`, or `job`.\n\n---\n\n## Labels to Avoid — Quick Reference\n\n| Label | Why | Alternative |\n|---|---|---|\n| `pod` | Transient, high card | Demote: `workload` label + `pod` in structured metadata (migrate selectors) |\n| `user_id` | Unbounded — never valid as index label | Keep only in log content |\n| `request_id` \u002F `trace_id` | Unbounded — never valid as index label | Structured metadata |\n| `filename` (raw K8s path) | Contains pod UID | Normalize or demote after selector check |\n| Unnormalized `level` | `INFO`\u002F`info`\u002F`Info` = 3 streams | Normalize at collection time |\n| UUID \u002F ephemeral `service_name` *values* | Inflates streams; key is still required | Keep key; map values to stable service identity |\n| Any dynamically-named label key | Cannot be bounded | Use fixed keys with bounded values |\n\n**Never drop:** `service_name`, `deployment_environment`, `job` — see [references\u002Fprotected-labels.md](references\u002Fprotected-labels.md).\n\n---\n\n## Cost Impact Analysis\n\nLabel hygiene alone does not cut billable ingest bytes ($0 direct). Volume savings come from enabled `stage.drop` \u002F log-line cleanup. Load [references\u002Fcost-impact.md](references\u002Fcost-impact.md) when writing the report section: use its scenario-card shape, cite scalar metrics (optional short panel ID \u002F PromQL), and never paste the agent-only reference table or panel JSON into the customer report.\n",{"name":5,"license":15,"version":24,"description":7},"1.0.0","main","3b63fa056f5de7956766fca020e9c71fdf2b0fab","SKILL\u002Fdevops\u002Ftier1\u002Fgrafana-loki-label-analyzer",0,"https:\u002F\u002Fgithub.com\u002Fyhyu13\u002FAgentSkillsVault","https:\u002F\u002Fgithub.com\u002Fyhyu13","https:\u002F\u002Fyhyu13.github.io","大丈夫自立于天地之间，岂可郁郁久居于人下\r\nA zealot of AI.","2026-11-14 20:53:07",{"source":8,"skillName":5,"commands":35,"prompt":45,"zipAvailable":46},[36,39,42],{"tool":37,"command":38},"npx","npx skills add yhyu13\u002FAgentSkillsVault --skill grafana-loki-label-analyzer",{"tool":40,"command":41},"bunx","bunx skills add yhyu13\u002FAgentSkillsVault --skill grafana-loki-label-analyzer",{"tool":43,"command":44},"pnpm","pnpm dlx skills add yhyu13\u002FAgentSkillsVault --skill grafana-loki-label-analyzer","安装技能，技能地址：https:\u002F\u002Fgithub.com\u002Fyhyu13\u002FAgentSkillsVault\u002Fblob\u002Fmain\u002FSKILL\u002Fdevops\u002Ftier1\u002Fgrafana-loki-label-analyzer\u002FSKILL.md",true,[48,54,58,62],{"path":49,"resourceType":50,"resourceTypeDesc":51,"sizeBytes":52,"sourceHtmlUrl":53},"references\u002Fcost-impact.md","REFERENCE","参考文档",6373,"https:\u002F\u002Fgithub.com\u002Fyhyu13\u002FAgentSkillsVault\u002Fblob\u002Fmain\u002FSKILL\u002Fdevops\u002Ftier1\u002Fgrafana-loki-label-analyzer\u002Freferences\u002Fcost-impact.md",{"path":55,"resourceType":50,"resourceTypeDesc":51,"sizeBytes":56,"sourceHtmlUrl":57},"references\u002Fdisclaimer.md",1001,"https:\u002F\u002Fgithub.com\u002Fyhyu13\u002FAgentSkillsVault\u002Fblob\u002Fmain\u002FSKILL\u002Fdevops\u002Ftier1\u002Fgrafana-loki-label-analyzer\u002Freferences\u002Fdisclaimer.md",{"path":59,"resourceType":50,"resourceTypeDesc":51,"sizeBytes":60,"sourceHtmlUrl":61},"references\u002Flog-line-optimization.md",1947,"https:\u002F\u002Fgithub.com\u002Fyhyu13\u002FAgentSkillsVault\u002Fblob\u002Fmain\u002FSKILL\u002Fdevops\u002Ftier1\u002Fgrafana-loki-label-analyzer\u002Freferences\u002Flog-line-optimization.md",{"path":63,"resourceType":50,"resourceTypeDesc":51,"sizeBytes":64,"sourceHtmlUrl":65},"references\u002Fprotected-labels.md",2652,"https:\u002F\u002Fgithub.com\u002Fyhyu13\u002FAgentSkillsVault\u002Fblob\u002Fmain\u002FSKILL\u002Fdevops\u002Ftier1\u002Fgrafana-loki-label-analyzer\u002Freferences\u002Fprotected-labels.md",[67,75,82,89,96,103],{"skillNo":68,"name":69,"nameZh":6,"description":70,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":71,"licenseFileUrl":6,"sourceHtmlUrl":72,"categories":73,"keywords":74,"publishedAt":19},"01M7DZJW3GMCBHNCC1J37K73T7","feishu-kdocs-cli","Office cloud CLIs for agents: install, authenticate, verify and troubleshoot Feishu `lark-cli` and Kingsoft\u002FWPS Docs `kdocs-cli`, plus the three China office MCP endpoints (Feishu, WPS SkillHub, Tencent Docs). Use when setting up or re-logging-in 飞书 CLI \u002F 金山文档 CLI, when a command fails with missing scope \u002F PATH \u002F token \u002F device-code errors, when a kdocs or lark command returns 400001 or unknown action, or when wiring 飞书 \u002F 金山文档 \u002F 腾讯文档 MCP into Cindy, Claude or another host. Not a per-command reference: domain commands live in the lark-* Skills and the kdocs Skill.","MIT","https:\u002F\u002Fgithub.com\u002Fyhyu13\u002FAgentSkillsVault\u002Fblob\u002Fmain\u002FSKILL\u002Fdevops\u002Ftier0\u002Ffeishu-kdocs-cli\u002FSKILL.md",[],[],{"skillNo":76,"name":77,"nameZh":6,"description":78,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":71,"licenseFileUrl":6,"sourceHtmlUrl":79,"categories":80,"keywords":81,"publishedAt":19},"01M7BE0VQF0T7ACMY3W9V27ZYG","vfx-fx","Cinematic and game VFX in Blender including smoke, fire, particles, trails, and Geometry Nodes FX setups via MCP.","https:\u002F\u002Fgithub.com\u002Fyhyu13\u002FAgentSkillsVault\u002Fblob\u002Fmain\u002FSKILL\u002Fgame-dev\u002Ftier2\u002Fvfx-fx\u002FSKILL.md",[],[],{"skillNo":83,"name":84,"nameZh":6,"description":85,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":71,"licenseFileUrl":6,"sourceHtmlUrl":86,"categories":87,"keywords":88,"publishedAt":19},"01M7BE0Q23SY6QAW24XEADEH0N","uv-workflow","Production UV unwrapping for seam placement, UV packing, texel density, UDIM, lightmap UVs, and modular UV layouts. Use when preparing meshes for texturing and engine export in Blender via MCP.","https:\u002F\u002Fgithub.com\u002Fyhyu13\u002FAgentSkillsVault\u002Fblob\u002Fmain\u002FSKILL\u002Fgame-dev\u002Ftier2\u002Fuv-workflow\u002FSKILL.md",[],[],{"skillNo":90,"name":91,"nameZh":6,"description":92,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":71,"licenseFileUrl":6,"sourceHtmlUrl":93,"categories":94,"keywords":95,"publishedAt":19},"01M7BE0JAKENVJB4Z0SV3Q7QGR","texture-workflow","Production texture workflow for atlases, baking AO\u002Fcurvature\u002Fnormal\u002Froughness maps, decals, and texture memory optimization. Use for game-ready texture pipelines in Blender via MCP.","https:\u002F\u002Fgithub.com\u002Fyhyu13\u002FAgentSkillsVault\u002Fblob\u002Fmain\u002FSKILL\u002Fgame-dev\u002Ftier2\u002Ftexture-workflow\u002FSKILL.md",[],[],{"skillNo":97,"name":98,"nameZh":6,"description":99,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":71,"licenseFileUrl":6,"sourceHtmlUrl":100,"categories":101,"keywords":102,"publishedAt":19},"01M7BE0CYB7BDJP7HD5WTS2PJB","sculpting","Blender sculpting for organic and hard surface detail using Dyntopo, multiresolution, brushes, alpha workflow, wrinkles, and damage. Use when high-frequency surface detail is needed before retopology in Blender via MCP.","https:\u002F\u002Fgithub.com\u002Fyhyu13\u002FAgentSkillsVault\u002Fblob\u002Fmain\u002FSKILL\u002Fgame-dev\u002Ftier2\u002Fsculpting\u002FSKILL.md",[],[],{"skillNo":104,"name":105,"nameZh":6,"description":106,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":71,"licenseFileUrl":6,"sourceHtmlUrl":107,"categories":108,"keywords":109,"publishedAt":19},"01M7BE09TBX9NQ5EBHN4JZ9VXM","scene-assembly","Large scene layout in Blender with collections, linking, overrides, streaming-friendly organization, and set assembly via MCP.","https:\u002F\u002Fgithub.com\u002Fyhyu13\u002FAgentSkillsVault\u002Fblob\u002Fmain\u002FSKILL\u002Fgame-dev\u002Ftier2\u002Fscene-assembly\u002FSKILL.md",[],[]]