Mimir

作者 grafana1ccacf29049fApache-2.0279 個星標收錄於 2026年10月8日更新於 2026年10月8日儲存庫今天更新

Stand up Grafana Mimir for horizontally scalable, multi-tenant, long-term Prometheus + OTLP metrics storage. Covers monolithic / read-write / microservices deployment, S3 / GCS / Azure / filesystem block storage, Prometheus `remote_write` and OTLP ingestion, multi-tenancy with `X-Scope-OrgID`, ingester replication factor, compactor retention, and per-tenant limits. Use when running Mimir locally or on Kubernetes (Helm `mimir-distributed`), scaling Prometheus past a single node, picking ingest / query / backend split, configuring tenants and ingestion rate, debugging `/ready` 503s or `429 Too Many Requests`, or pointing Grafana at a Mimir datasource — even when the user says "I need long-term Prometheus storage", "scale Prometheus", "multi-tenant metrics backend", "Cortex replacement", "remote_write target", or "store 10M active series" without naming Mimir.

僅含說明DevOps & Cloud
AI 產生的概覽

指導架設與維運 Grafana Mimir,用於可擴充、多租戶、長期的 Prometheus 與 OTLP 指標儲存。

功能
此技能提供部署 Grafana Mimir 的設定與指令指引,涵蓋單體、讀寫分離與微服務模式,包括本機 Docker 執行與 Kubernetes Helm 安裝。內容涉及區塊儲存後端、Prometheus remote_write 與 Grafana Alloy 資料寫入、透過 X-Scope-OrgID 標頭實現多租戶、複本因子、壓縮器保留策略以及各租戶限制。也包含驗證步驟,以及就緒檢查失敗、限流與查詢結果為空等問題的排解方式。
適用情境
適用於將 Prometheus 擴充到單一節點之外、建置多租戶長期指標後端,或汰換 Cortex 的情境。也適合排解 Mimir 就緒狀態或資料寫入錯誤,以及將 Grafana 連接至 Mimir 資料來源時使用。
執行需求
需要 Docker 或搭配 Helm 的 Kubernetes 叢集進行部署,正式環境需要物件儲存桶(S3、GCS 或 Azure),以及能夠 remote_write 的 Prometheus 或 Alloy 執行個體。此技能不含指令碼,僅為說明文件,另附兩份參考文件。

Grafana Mimir

Docs: https://grafana.com/docs/mimir/latest/

Horizontally scalable, multi-tenant, long-term storage for Prometheus + OpenTelemetry metrics.

Prerequisites

  • Docker (for quick start) or a Kubernetes cluster (for Helm)
  • An object-storage bucket for production (S3/GCS/Azure) — filesystem only for dev
  • Prometheus or Alloy able to remote_write to the Mimir push endpoint

Common Workflows

1. Stand up monolithic Mimir locally

yaml
# demo.yamltarget: allmultitenancy_enabled: false
blocks_storage:  backend: filesystem  bucket_store:    sync_dir: /tmp/mimir/tsdb-sync  filesystem:    dir: /tmp/mimir/data/tsdb  tsdb:    dir: /tmp/mimir/tsdb
compactor:  data_dir: /tmp/mimir/compactor  sharding_ring:    kvstore: { store: memberlist }
distributor:  ring:    instance_addr: 127.0.0.1    kvstore: { store: memberlist }
ingester:  ring:    instance_addr: 127.0.0.1    kvstore: { store: memberlist }    replication_factor: 1
server:  http_listen_port: 9009  grpc_listen_port: 9095  log_level: error
bash
# 1. Run itdocker run --rm -p 9009:9009 -v $(pwd)/demo.yaml:/etc/mimir/demo.yaml \  grafana/mimir:latest --config.file=/etc/mimir/demo.yaml
# 2. Verify readiness (expect HTTP 200, body: "ready")curl -sf http://localhost:9009/ready
# 3. Verify it's serving the APIcurl -s http://localhost:9009/api/v1/labels | jq '.status'   # → "success"
# 4. Verify self-metrics scrapecurl -s http://localhost:9009/metrics | grep -E '^mimir_(distributor|ingester)_' | head

2. Send metrics — Prometheus remote_write

yaml
remote_write:  - url: http://localhost:9009/api/v1/push    headers:      X-Scope-OrgID: tenant1   # required when multitenancy_enabled: true
bash
# Verify samples are landingcurl -s -H 'X-Scope-OrgID: tenant1' \  'http://localhost:9009/api/v1/query?query=up' | jq '.data.result | length'# Expect > 0 within ~30s of Prometheus scraping

3. Send metrics — Grafana Alloy

alloy
prometheus.remote_write "mimir" {  endpoint {    url = "http://mimir:9009/api/v1/push"    headers = { "X-Scope-OrgID" = "tenant1" }  }}

4. Deploy on Kubernetes (Helm, microservices)

bash
# 1. Installhelm repo add grafana https://grafana.github.io/helm-chartshelm install mimir grafana/mimir-distributed --version 6.0.6 -f values.yaml
# 2. Verify every pod is Running / Readykubectl get pods -n mimir#   distributor, ingester, querier, query-frontend, store-gateway, compactor, ruler
# 3. Verify the gateway is readykubectl port-forward -n mimir svc/mimir-nginx 9009:80 &curl -sf http://localhost:9009/ready

Multi-tenancy

yaml
multitenancy_enabled: true# Every request must include header:  X-Scope-OrgID: <tenant-id>

For storage backends (S3 / GCS / Azure / filesystem) see references/storage.md [blocked]. For component roles, ring options, limits, and API endpoint dumps see references/architecture.md [blocked].

Troubleshooting

  • /ready returns 503 → ingester still joining ring; check mimir_ring_members and ingester logs
  • 429 Too Many Requests on push → bump limits.ingestion_rate / ingestion_burst_size
  • Samples written but query returns empty → confirm X-Scope-OrgID matches between write and read
  • Query for old data returns nothing → check compactor logs and that store-gateway has synced blocks

Resources

來源與署名

來源:grafana/skills位於skills/grafana-lgtm/mimir提交1ccacf2

授權條款: Apache-2.0

內容歸原作者所有。SourceWeft 從公開儲存庫中收錄這些內容。

檢舉或申請下架

更多來自 grafana/skills 的技能

React 19 Plugin Migration

grafana

指導將 Grafana 外掛遷移至 React 19 相容,依序完成建置、相依性與原始碼修改步驟。

Software Development279今天更新

Plugin Bundle Size

grafana

指導使用 React.lazy、Suspense 與 webpack 程式碼分割來最佳化 Grafana 應用程式外掛的打包體積。

Software Development279今天更新

Grafana Scenes

grafana

使用 @grafana/scenes 框架建置 Grafana 外掛頁面,涵蓋場景、面板、變數與下鑽導覽。

Software Development279今天更新

Check Npm

grafana

對 JS/TS 儲存庫的 npm、yarn 或 pnpm 設定進行唯讀供應鏈強化稽核。

Security279今天更新

K6 Trend Analysis

grafana

Analyze Grafana Cloud k6 test run trends over time. Detects slow metric drift (e.g., P95 latency creeping up while still passing thresholds), computes headroom to thresholds, flags anomalies, and recommends threshold tightening. Use when the user asks about test performance trends, wants to know if metrics are degrading, asks whether thresholds should be tightened, or wants a health check across recent runs for a specific test. Trigger on phrases like "how is my test trending", "is P95 getting worse", "check for performance regression", "should I tighten thresholds", "are my tests degrading", "show me trends for test X", "analyze my k6 test runs", or "is my test getting slower". Also trigger when a user asks to check all tests in a project -- run this skill once per test and synthesize.

待分類279今天更新

K6 Test Maintenance

grafana

維護與改善現有 k6 負載測試指令碼:收緊閾值、版本移轉、重構以及最佳實務稽核。

Software Development279今天更新