> ## Documentation Index
> Fetch the complete documentation index at: https://docs.controlplane.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Grafana Mimir

> Deploy Grafana Mimir on Control Plane using the Template Catalog. A self-hosted long-term metrics store for your own Prometheus, Alloy, or OpenTelemetry metrics, backed by S3, GCS, or S3-compatible object storage.

## Overview

Grafana Mimir is a long-term Prometheus metrics store you own. This template deploys Mimir in monolithic mode: your own collectors (Prometheus, Grafana Alloy, OpenTelemetry) push metrics in via Prometheus `remote_write`, and anything that speaks PromQL — your own Grafana, dashboards, scripts — queries them back, with metric blocks durably stored in your object bucket.

<Note>
  This is a **self-hosted metrics store for your own metrics from your own sources**. It is separate from — and not a replacement for — Control Plane's built-in observability, which continues to collect and dashboard your workloads' metrics natively.
</Note>

### Architecture

* **Mimir** — A single-replica stateful workload running all Mimir components in one process (`target: all`). Remote-write ingest and PromQL query on port `8080`, internal gRPC on `9095`, memberlist on `7946` (self-contained ring — no Consul or etcd).
* **Object storage** — Metric blocks live in your S3, GCS, or S3-compatible bucket; the persistent volume holds only the ingester WAL/TSDB and compactor workspace.

### What Gets Created

* **Stateful Mimir Workload** — Serves remote-write ingest and PromQL query on port `8080`.
* **Volume Set** — 20 GiB at `/data` for the ingester WAL/TSDB and compactor workspace.
* **Secret** — An opaque secret holding the rendered Mimir configuration, mounted as a file.
* **Identity & Policy** — An identity bound to the workload with `reveal` access to the config secret only, plus cloud access scoped to exactly your bucket (AWS and GCP backends).

<Note>
  This template does not create a GVC. You must deploy it into an existing GVC.
</Note>

## Prerequisites

Mimir requires an existing bucket in one of the supported backends and the access setup for it. Complete the steps for your chosen backend before installing.

<Tabs>
  <Tab title="AWS S3">
    AWS S3 uses a Control Plane cloud identity — no credentials are stored; the workload's identity vends temporary credentials at runtime.

    <Steps>
      <Step title="Create a bucket">
        Create an S3 bucket. Set `storage.aws.bucket` and `storage.aws.region` to match.
      </Step>

      <Step title="Set up a Cloud Account">
        If you do not have one, [create a Cloud Account](https://docs.controlplane.com/guides/create-cloud-account) for your AWS account. Set `storage.aws.cloudAccountName` to its name.
      </Step>

      <Step title="Create a bucket-scoped IAM policy">
        Create an AWS IAM policy with the JSON below (replace `YOUR_BUCKET`), then set `storage.aws.policyName` to the policy's name (bare name, not ARN):

        ```json theme={null}
        {
          "Version": "2012-10-17",
          "Statement": [
            {
              "Effect": "Allow",
              "Action": ["s3:ListBucket", "s3:GetObject", "s3:PutObject", "s3:DeleteObject"],
              "Resource": [
                "arn:aws:s3:::YOUR_BUCKET",
                "arn:aws:s3:::YOUR_BUCKET/*"
              ]
            }
          ]
        }
        ```
      </Step>
    </Steps>
  </Tab>

  <Tab title="Google Cloud Storage">
    Google Cloud Storage uses a Control Plane cloud identity — no credentials are stored.

    <Steps>
      <Step title="Create a bucket">
        Create a GCS bucket. Set `storage.gcp.bucket` to its name.
      </Step>

      <Step title="Set up a Cloud Account">
        If you do not have one, [create a Cloud Account](https://docs.controlplane.com/guides/create-cloud-account) for your GCP project. Set `storage.gcp.cloudAccountName` to its name.
      </Step>

      <Step title="Confirm bucket access">
        No policy to author — the template grants the workload identity `roles/storage.objectAdmin` scoped to the bucket automatically.
      </Step>
    </Steps>
  </Tab>

  <Tab title="S3-compatible (MinIO, R2, Wasabi)">
    Any S3-compatible server uses static access credentials, since these cannot federate with a cloud account.

    <Steps>
      <Step title="Create a bucket">
        Create your bucket on the server and credentials that can read and write it. Set `storage.minio.bucket`, `storage.minio.accessKey`, and `storage.minio.accessSecret` to match.
      </Step>

      <Step title="Set the endpoint">
        Set `storage.minio.endpoint` to the S3 API address as `host:port` with **no scheme** (e.g. `my-minio:9000`), and `storage.minio.insecure: true` when the endpoint is plain HTTP. For the `minio` marketplace template deployed in the same GVC, this is `WORKLOAD_NAME.GVC_NAME.cpln.local:9000` with `insecure: true`.
      </Step>
    </Steps>
  </Tab>
</Tabs>

Once your backend is ready, install the template using your preferred method:

<CardGroup cols={2}>
  <Card title="UI" href="/template-catalog/install-manage/ui" icon="laptop">
    Browse, install, and manage templates visually
  </Card>

  <Card title="CLI" href="/template-catalog/install-manage/cli" icon="terminal">
    Manage templates from your terminal
  </Card>

  <Card title="Terraform" href="/template-catalog/install-manage/terraform" icon={<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 128 128"><g fill-rule="evenodd"><path d="M77.941 44.5v36.836L46.324 62.918V26.082zm0 0" fill="#5c4ee5"/><path d="M81.41 81.336l31.633-18.418V26.082L81.41 44.5zm0 0" fill="#4040b2"/><path d="M11.242 42.36L42.86 60.776V23.941L11.242 5.523zm0 0M77.941 85.375L46.324 66.957v36.82l31.617 18.418zm0 0" fill="#5c4ee5"/></g></svg>}>
    Declare templates in your Terraform configurations
  </Card>

  <Card
    title="Pulumi"
    href="/template-catalog/install-manage/pulumi"
    icon={<svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" id="Pulumi-Icon--Streamline-Svg-Logos" height="24" width="24">
    <desc>
        Pulumi Icon Streamline Icon: https://streamlinehq.com
    </desc>
    <path fill="#f26e7e" d="M4.683025 13.3318c0.869125 -0.5018 0.870575 -2.1264 0.003225 -3.62865s-2.27504 -2.313275 -3.1441725 -1.811475C0.672945 8.3935 0.6715 10.0181 1.53885 11.52035c0.86735 1.502275 2.27505 2.313275 3.144175 1.81145Zm0.0052 3.2167c0.86735 1.502275 0.865925 3.126875 -0.003225 3.628675 -0.86915 0.5018 -2.2768275 -0.309225 -3.144175 -1.81145 -0.8673525 -1.50225 -0.8659075 -3.126875 0.003225 -3.628675 0.8691325 -0.5018 2.276825 0.309225 3.144175 1.81145Zm5.922875 3.4243c0.86735 1.50225 0.8659 3.126775 -0.003225 3.62875 -0.869125 0.501775 -2.27685 -0.309325 -3.1442 -1.81155 -0.867325 -1.50225 -0.865875 -3.12685 0.00325 -3.628675 0.869125 -0.5018 2.276825 0.309225 3.144175 1.811475Zm-0.001925 -6.845275c0.86735 1.50225 0.8659 3.12685 -0.003225 3.628675 -0.869125 0.5018 -2.276825 -0.309225 -3.144175 -1.811475 -0.86735 -1.50225 -0.8659 -3.12685 0.003225 -3.62865 0.869125 -0.501825 2.276825 0.3092 3.144175 1.81145Z" stroke-width="0.25"></path>
    <path fill="#8a3391" d="M22.45775 11.524125c0.86725 -1.502225 0.865925 -3.12685 -0.003225 -3.62865 -0.869125 -0.501825 -2.276825 0.3092 -3.144175 1.811475 -0.86735 1.50225 -0.8659 3.126825 0.003225 3.62865 0.869125 0.501825 2.276825 -0.3092 3.144175 -1.811475Zm0.000175 3.2151c0.869075 0.5018 0.870625 2.1264 0.003225 3.62865 -0.86735 1.50225 -2.27505 2.313275 -3.144175 1.81145 -0.869125 -0.5018 -0.870575 -2.126425 -0.003225 -3.62865 0.86735 -1.50225 2.27505 -2.313275 3.144175 -1.81145ZM16.536225 18.157875c0.86915 0.501825 0.8706 2.126425 0.00325 3.628675 -0.86735 1.502125 -2.275075 2.313225 -3.1442 1.81145 -0.869125 -0.50175 -0.870575 -2.126425 -0.003225 -3.62865 0.867375 -1.502275 2.27505 -2.3133 3.144175 -1.811475Zm-0.003325 -6.843775c0.869125 0.5018 0.870575 2.126425 0.003225 3.628675s-2.27505 2.313275 -3.1442 1.811475c-0.869125 -0.501825 -0.870575 -2.126425 -0.003225 -3.628675 0.86735 -1.502275 2.27505 -2.313275 3.1442 -1.811475Z" stroke-width="0.25"></path>
    <path fill="#f7bf2a" d="M15.138225 2.06721c0 1.003615 -1.40625 1.817215 -3.14095 1.817215 -1.7347 0 -3.14095 -0.8136 -3.14095 -1.817215C8.856325 1.06359 10.262575 0.25 11.997275 0.25c1.7347 0 3.14095 0.81359 3.14095 1.81721ZM9.2166 5.482375c0 1.003625 -1.40625 1.8172 -3.14095 1.8172 -1.7347 0 -3.14095 -0.813575 -3.14095 -1.8172s1.40625 -1.817225 3.14095 -1.817225c1.7347 0 3.14095 0.8136 3.14095 1.817225Zm8.71005 1.8172c1.7347 0 3.14095 -0.813575 3.14095 -1.8172s-1.40625 -1.817225 -3.14095 -1.817225c-1.7347 0 -3.14095 0.8136 -3.14095 1.817225s1.40625 1.8172 3.14095 1.8172Zm-2.788425 1.605625c0 1.003625 -1.40625 1.8172 -3.14095 1.8172 -1.7347 0 -3.14095 -0.813575 -3.14095 -1.8172 0 -1.0036 1.40625 -1.8172 3.14095 -1.8172 1.7347 0 3.14095 0.8136 3.14095 1.8172Z" stroke-width="0.25"></path>
    </svg>}
  >
    Declare templates in your Pulumi programs
  </Card>
</CardGroup>

## Configuration

The default `values.yaml` for this template:

```yaml theme={null}
image: grafana/mimir:3.1.3

resources: # monolithic Mimir; memory governs ingestable series count
  cpu: 1000m
  memory: 2Gi
  minCpu: 500m
  minMemory: 1Gi

replicas: 1 # 1 for a single instance; 3 or more forms an HA cluster with 3-way replication

storage:
  type: aws # options: aws, gcp, minio

  aws: # AWS S3 — via Control Plane cloud identity
    bucket: my-mimir-bucket # bucket must already exist
    region: us-east-1
    cloudAccountName: my-s3-cloud-account # Control Plane AWS cloud account
    policyName: my-mimir-s3-policy # custom IAM policy granting bucket access (bare name)

  gcp: # Google Cloud Storage — via Control Plane cloud identity
    bucket: my-mimir-bucket # bucket must already exist
    cloudAccountName: my-gcs-cloud-account # Control Plane GCP cloud account

  minio: # Any S3-compatible server (MinIO, R2, Wasabi, …) — static keys + endpoint
    endpoint: my-minio:9000 # host:port, NO scheme
    insecure: true # true when the endpoint is plain HTTP
    bucket: my-mimir-bucket # bucket must already exist
    region: us-east-1
    accessKey: my-minio-username
    accessSecret: my-minio-password

multitenancy:
  enabled: false # when true, every client request must send X-Scope-OrgID: <tenant>

retention:
  period: "0" # blocks retention, e.g. 30d, 13w, 1y — "0" keeps data forever

volumeset:
  capacity: 20 # GiB — ingester WAL/TSDB and compactor workspace at /data

internalAccess:
  type: same-gvc # options: none, same-gvc, same-org, workload-list
  workloads: [] # used with workload-list, e.g. //gvc/GVC/workload/NAME
```

### Resources

* `image` — The Grafana Mimir container image.
* `resources` — CPU and memory for the Mimir container. Memory governs how many active series you can ingest.

### Storage Backend

Set `storage.type` to `aws`, `gcp`, or `minio`, and configure that block. AWS and GCP use a Control Plane cloud identity — no credentials are stored; the workload's identity vends temporary credentials at runtime. See [Prerequisites](#prerequisites) for the per-backend setup steps.

| Field                        | Backends       | Description                                         |
| ---------------------------- | -------------- | --------------------------------------------------- |
| `bucket`                     | all            | Target bucket. Must already exist.                  |
| `region`                     | `aws`, `minio` | Bucket region.                                      |
| `cloudAccountName`           | `aws`, `gcp`   | Control Plane cloud account granting bucket access. |
| `policyName`                 | `aws`          | Bare name of the custom bucket-scoped IAM policy.   |
| `endpoint`                   | `minio`        | S3 API address as `host:port` — no scheme.          |
| `insecure`                   | `minio`        | `true` when the endpoint is plain HTTP.             |
| `accessKey` / `accessSecret` | `minio`        | Static credentials with access to the bucket.       |

One bucket serves the whole deployment; the template namespaces its contents internally.

### Multitenancy

* `multitenancy.enabled` — When `true`, **every** request (push and query) must carry an `X-Scope-OrgID: <tenant>` header; requests without it are rejected with `401 no org id`. Tenants are implicit — writing with a new tenant ID creates it, and each tenant's series are fully isolated from the others. No provisioning step.

<Warning>
  `X-Scope-OrgID` identifies a tenant; it does **not** authenticate anyone. Any client that can reach Mimir can send any tenant header. Tenancy is a namespacing mechanism, not a security boundary.
</Warning>

### Retention

* `retention.period` — Blocks retention enforced by the compactor, e.g. `30d`, `13w`, `1y`. The default `"0"` keeps data forever. Changing the period applies to existing blocks too.

### Storage Volume

* `volumeset.capacity` — Volume size in GiB for the ingester WAL/TSDB and compactor workspace at `/data`. Metric blocks are durably stored in your object bucket, not on the volume.

### Internal Access

Mimir is **internal-only by design** — it has no built-in authentication, so this template never exposes a public endpoint. `internalAccess.type` controls which workloads can reach port `8080`:

| Type            | Description                                                     |
| --------------- | --------------------------------------------------------------- |
| `none`          | No internal access allowed                                      |
| `same-gvc`      | Allow access from all workloads in the same GVC                 |
| `same-org`      | Allow access from all workloads in the same organization        |
| `workload-list` | Allow access only from specific workloads listed in `workloads` |

To serve clients outside Control Plane, front Mimir with your own authenticating proxy behind a custom domain — that proxy is yours to build and operate; the template does not provide one.

## Connecting

| What                                        | Value                                                            |
| ------------------------------------------- | ---------------------------------------------------------------- |
| Remote-write ingest (from your collectors)  | `http://RELEASE_NAME-mimir.GVC_NAME.cpln.local:8080/api/v1/push` |
| PromQL / Grafana datasource                 | `http://RELEASE_NAME-mimir.GVC_NAME.cpln.local:8080/prometheus`  |
| Tenant header (when `multitenancy.enabled`) | `X-Scope-OrgID: <tenant>` on every request                       |

Point your collectors at the ingest endpoint. For Prometheus:

```yaml theme={null}
remote_write:
  - url: http://RELEASE_NAME-mimir.GVC_NAME.cpln.local:8080/api/v1/push
    # headers:
    #   X-Scope-OrgID: team-a # only when multitenancy.enabled
```

Point a Grafana Prometheus datasource at the PromQL URL. Because Mimir is internal-only, collectors and Grafana must run inside the GVC (or org, per `internalAccess`) to reach it.

## Important Notes

* **After scaling `replicas` 1 → 3 on a live install**, metrics written shortly before the scale-up can be intermittently invisible to queries for up to \~12 hours while their blocks age into the store — no data is lost and it resolves on its own.
* **Mimir has no built-in authentication, so this template never exposes a public endpoint.** The `X-Scope-OrgID` header identifies a tenant; it does not authenticate anyone. To serve clients outside Control Plane, front Mimir with your own authenticating proxy behind a custom domain.
* **With `multitenancy.enabled: true`, every request needs `X-Scope-OrgID`** — pushes and queries without it are rejected; tenants are implicit (no provisioning step).
* **Transient "Access Denied" warnings in the first seconds of a fresh boot may appear** — the workload identity's cloud credentials are still being issued; Mimir retries and proceeds on its own.
* **Data lives in your bucket** — the volume set only holds the WAL and scratch space. Reinstalling the template against the same bucket resumes with your data; deleting data means emptying the bucket.
* **Retention is enforced by the compactor** — changing `retention.period` applies to existing blocks too.
* **After uninstall, re-check your bucket** — the terminating replica can re-write a small cluster-seed file (`blocks/__mimir_cluster/`) minutes after teardown; delete it if you are emptying the bucket.

## External References

<CardGroup cols={2}>
  <Card title="Grafana Mimir Documentation" icon="book" href="https://grafana.com/docs/mimir/latest/">
    Official Grafana Mimir documentation
  </Card>

  <Card title="Prometheus remote_write" icon="chart-line" href="https://prometheus.io/docs/practices/remote_write/">
    Remote-write tuning and best practices
  </Card>

  <Card title="Mimir HTTP API" icon="server" href="https://grafana.com/docs/mimir/latest/references/http-api/">
    Ingest, query, and status endpoints reference
  </Card>

  <Card title="Grafana Mimir (GitHub)" icon="github" href="https://github.com/grafana/mimir">
    Source code and releases
  </Card>

  <Card title="Mimir Template" icon="github" href="https://github.com/controlplane-com/templates/tree/main/mimir">
    View the source files, default values, and chart definition
  </Card>
</CardGroup>
