# grafana

Grafana: observability and data visualization

This page is generated from [`kix/packages/stable/grafana`](https://github.com/kix-run/kix/tree/main/kix/packages/stable/grafana).

| | |
| --- | --- |
| Stability | Stable |
| `package` value | `packages.grafana` |
| Default software version | `13.3.1` |
| Default aliases | `grafana` |

## How-to guides

- [Install the monitoring stack](/docs/how-to/package-task-guides/install-the-monitoring-stack/)
- [Install the VictoriaMetrics HA monitoring stack](/docs/how-to/package-task-guides/install-the-victoriametrics-ha-monitoring-stack/)

## Dependencies

Kix matches each dependency below to another package instance by instance name, alias, or role. To bind a specific instance, set [`deps.<name>`](/docs/reference/instances-and-composition/#deps) in your cluster definition. See [Declaring dependencies](/docs/reference/package-anatomy/#declaring-dependencies) for how required and optional dependencies work.

| Dependency | Requirement |
| --- | --- |
| `grafanaAdmin` | Required |
| `alertmanager` | Optional |
| `clusterIssuer` | Optional |
| `gateway` | Optional |
| `ingressNginx` | Optional |
| `loki` | Optional |
| `oidc` | Optional |
| `prometheus` | Optional |
| `prometheusServer` | Optional |
| `smtp` | Optional |
| `storage` | Optional |
| `tempo` | Optional |

## Options

### `alertmanagerDatasource`

Name and uid of the Alertmanager datasource wired from the `alertmanager` dependency.

- **Type:** `submodule`
- **Default:** `{ }`

### `alertmanagerDatasource.name`

Display name in the datasource picker.

- **Type:** `string`
- **Default:** `"Alertmanager"`

### `alertmanagerDatasource.uid`

Stable identifier that dashboards refer to.

- **Type:** `string`
- **Default:** `"alertmanager"`

### `datasources`

Datasources provisioned after the wired ones, in Grafana's provisioning format. Under default deny Grafana gets no automatic egress to their URLs; add a network policy that allows it. Because entries land in a ConfigMap, credentials in `secureJsonData`, `password`, or `basicAuthPassword` must use a reference Grafana expands (`$VAR` from `env` or `$__file{<path>}`); literal strings are refused.

- **Type:** `list of (open submodule of attribute set of anything)`
- **Default:** `[ ]`
- **Example:**

  ```nix
  [
    {
      access = "proxy";
      name = "Pyroscope";
      type = "grafana-pyroscope-datasource";
      uid = "pyroscope";
      url = "https://pyroscope.example.com";
    }
  ]
  ```

### `datasources.*.name`

Display name in the datasource picker.

- **Type:** `non-empty string`

### `datasources.*.type`

Datasource plugin id, such as `prometheus`, `loki`, or `postgres`.

- **Type:** `non-empty string`

### `deleteDatasources`

Datasources Grafana deletes from its database by name before
provisioning. Grafana matches provisioned datasources by name, so
renaming one while keeping its uid fails unless the old name is listed
here. Deleting a nonexistent name is a no-op.

- **Type:** `list of (submodule)`
- **Default:** `[ ]`
- **Example:**

  ```nix
  [
    {
      name = "Prometheus";
    }
  ]
  ```

### `deleteDatasources.*.name`

Name of the datasource to delete before provisioning.

- **Type:** `string`

### `deleteDatasources.*.orgId`

Organization ID of the datasource to delete.

- **Type:** `signed integer`
- **Default:** `1`

### `env`

Extra environment variables for Grafana, such as `GF_<SECTION>_<KEY>` settings: a string, a `fieldRef` source, or a `secretKeyRef` source naming a Secret managed outside Kix with `kix.untrackedRef`. The `GF_PATHS_*` variables and the administrator login from `grafanaAdmin` are refused.

- **Type:** ``attribute set of (null or string or env var source with `valueFrom`)``
- **Default:** `{ }`

### `image`

Container image for this instance. Set it from a pin file (`kix.pins`) so the deployed reference is committed and resolved.

- **Type:** `submodule`
- **Default:**

  ```nix
  {
    digest = "sha256:0615ec4fbd4072004b7d86b46ded63013a74b7d6eb1119273dd89e8fa25c13cf";
    pullPolicy = "IfNotPresent";
    repository = "docker.io/grafana/grafana";
    tag = "13.3.1";
  }
  ```

### `image.digest`

Resolved manifest digest, `sha256:` followed by 64 hex characters. What will actually run. Null means not resolved.

- **Type:** `null or string`
- **Default:** the package's digest while `tag` is the package's tag, otherwise null

### `image.note`

Whatever a person wanted to say about this pin. Kix never reads it and a promotion never discards it. Declared here for the same reason as the three fields above: a pin carries its own record-keeping, and the option accepts the whole pin rather than a subset of it.

- **Type:** `null or string`
- **Default:** `null`

### `image.promotedBy`

Who resolved this pin, for the record. Null when unknown.

- **Type:** `null or string`
- **Default:** `null`

### `image.pullPolicy`

imagePullPolicy for containers using this image. Null leaves it to Kubernetes.

- **Type:** `null or string`
- **Default:** `"IfNotPresent"`

### `image.repository`

Image repository, registry host included.

- **Type:** `string`
- **Default:** `"docker.io/grafana/grafana"`

### `image.resolvedAt`

When this pin was resolved, RFC 3339. Null when unknown.

- **Type:** `null or string`
- **Default:** `null`

### `image.sourceRev`

Revision of the source the image was built from, when Kix built it. Null for upstream images.

- **Type:** `null or string`
- **Default:** `null`

### `image.tag`

Image tag. What was asked for.

- **Type:** `string`
- **Default:** `"13.3.1"`

### `ingress.annotations`

Annotations added to the generated Ingress or HTTPRoute (for example, external-dns annotations). Keys set here override package defaults.

- **Type:** `attribute set of string`
- **Default:** `{ }`

### `ingress.extraHosts`

Additional hostnames added to the Ingress or HTTPRoute alongside `host`. In Gateway mode, a listener must accept each hostname or evaluation fails. The instance's public URL (`self.exposure.url`) still uses `host`.

- **Type:** `list of string`
- **Default:** `[ ]`
- **Example:**

  ```nix
  [
    "www.example.com"
  ]
  ```

### `ingress.host`

Public hostname of Grafana's route. Null means no route: Grafana does not default to `<instance>.<cluster.domain>` because the route also serves unauthenticated `/metrics`.

- **Type:** `null or string`
- **Default:** `null`

### `ingress.timeouts`

Gateway API HTTPRoute rule `timeouts` for this instance. When set, replaces any default `timeouts` set by the package; `null` keeps the package defaults. Ignored in Ingress mode.

- **Type:** `null or (submodule)`
- **Default:** `null`
- **Example:**

  ```nix
  {
    request = "0s";
  }
  ```

### `ingress.timeouts.backendRequest`

Maximum duration for a single request from the Gateway to a backend, as a Gateway API duration string such as `10s`.

- **Type:** `null or string`
- **Default:** `null`

### `ingress.timeouts.request`

Maximum duration for the entire client request, as a Gateway API duration string such as `30s`. Set `0s` to disable the timeout.

- **Type:** `null or string`
- **Default:** `null`

### `initChownData.enabled`

Run a root init container that chowns /var/lib/grafana to 472:472
before Grafana starts. Enable only when the storage driver ignores
`fsGroup`. Carries `CHOWN` and `DAC_READ_SEARCH` so root can traverse
mode-0700 directories Grafana created on prior starts.

- **Type:** `boolean`
- **Default:** `false`

### `initChownData.image`

Image of the init-chown-data container.

- **Type:** `submodule`
- **Default:**

  ```nix
  {
    digest = "sha256:fd7dc98638c8e305f4dc34e979f1c0fdfdcaeb0fbf8fcff77ae834b6da3d7e6e";
    pullPolicy = "IfNotPresent";
    repository = "docker.io/library/busybox";
    tag = "1.38.0";
  }
  ```

### `initChownData.image.digest`

Resolved manifest digest, `sha256:` followed by 64 hex characters. What will actually run. Null means not resolved.

- **Type:** `null or string`
- **Default:** the package's digest while `tag` is the package's tag, otherwise null

### `initChownData.image.note`

Whatever a person wanted to say about this pin. Kix never reads it and a promotion never discards it. Declared here for the same reason as the three fields above: a pin carries its own record-keeping, and the option accepts the whole pin rather than a subset of it.

- **Type:** `null or string`
- **Default:** `null`

### `initChownData.image.promotedBy`

Who resolved this pin, for the record. Null when unknown.

- **Type:** `null or string`
- **Default:** `null`

### `initChownData.image.pullPolicy`

imagePullPolicy for containers using this image. Null leaves it to Kubernetes.

- **Type:** `null or string`
- **Default:** `"IfNotPresent"`

### `initChownData.image.repository`

Image repository, registry host included.

- **Type:** `string`
- **Default:** `"docker.io/library/busybox"`

### `initChownData.image.resolvedAt`

When this pin was resolved, RFC 3339. Null when unknown.

- **Type:** `null or string`
- **Default:** `null`

### `initChownData.image.sourceRev`

Revision of the source the image was built from, when Kix built it. Null for upstream images.

- **Type:** `null or string`
- **Default:** `null`

### `initChownData.image.tag`

Image tag. What was asked for.

- **Type:** `string`
- **Default:** `"1.38.0"`

### `lokiDatasource`

Name and uid of the Loki datasource wired from the `loki` dependency.

- **Type:** `submodule`
- **Default:** `{ }`

### `lokiDatasource.name`

Display name in the datasource picker.

- **Type:** `string`
- **Default:** `"Loki"`

### `lokiDatasource.uid`

Stable identifier that dashboards refer to.

- **Type:** `string`
- **Default:** `"loki"`

### `mail.from`

Sender address for this instance's mail. Null uses the `smtp` instance's `out.from`.

- **Type:** `null or string matching the pattern [^@[:space:]]+@[^@[:space:]]+`
- **Default:** `null`
- **Example:** `"vault@example.org"`

### `metrics.enabled`

Enable metrics endpoint and monitoring resources (ServiceMonitor, PrometheusRules) when prometheus is available.

- **Type:** `boolean`
- **Default:** `true`

### `metrics.interval`

Scrape interval (e.g. "30s"). Null = use Prometheus default.

- **Type:** `null or string`
- **Default:** `null`

### `oidc.autoLogin`

Send users straight to the provider instead of showing the application's login page (`auth.generic_oauth.auto_login`).

- **Type:** `boolean`
- **Default:** `false`

### `oidc.scopes`

OAuth scopes the application requests. OpenID Connect needs `openid`, so a list without it is refused.

- **Type:** `list of scopes without spaces or commas that includes "openid"`
- **Default:**

  ```nix
  [
    "openid"
    "profile"
    "email"
  ]
  ```

### `prometheusDatasource`

Name and uid of the Prometheus datasource wired from the `prometheusServer` dependency.

- **Type:** `submodule`
- **Default:** `{ }`

### `prometheusDatasource.name`

Display name in the datasource picker.

- **Type:** `string`
- **Default:** `"Prometheus"`

### `prometheusDatasource.uid`

Stable identifier that dashboards refer to.

- **Type:** `string`
- **Default:** `"prometheus"`

### `resources`

Container resource requests and limits. Each field keeps its default until set, and null removes a default.

- **Type:** `submodule`
- **Default:**

  ```nix
  {
    limits = {
      cpu = "1";
      memory = "1Gi";
    };
    requests = {
      cpu = "100m";
      memory = "128Mi";
    };
  }
  ```

### `resources.claims`

Dynamic resource claims the container uses. Null leaves it unset.

- **Type:** `null or (list of (submodule))`
- **Default:** `null`

### `resources.claims.*.name`

Name of an entry in the pod's `resourceClaims`.

- **Type:** `string`

### `resources.claims.*.request`

Request within the claim to use. Null uses the whole claim.

- **Type:** `null or string`
- **Default:** `null`

### `resources.limits`

Resource quantities by name.

- **Type:** `open submodule of attribute set of Kubernetes quantity, such as "500m" or "1Gi" (a non-negative decimal or integer with an optional suffix m, k, M, G, T, P, E, Ki, Mi, Gi, Ti, Pi or Ei)`
- **Default:** `{ }`

### `resources.limits.cpu`

The cpu quantity. Null leaves it unset.

- **Type:** `null or Kubernetes quantity, such as "500m" or "1Gi" (a non-negative decimal or integer with an optional suffix m, k, M, G, T, P, E, Ki, Mi, Gi, Ti, Pi or Ei)`
- **Default:** `"1"`

### `resources.limits.ephemeral-storage`

The ephemeral-storage quantity. Null leaves it unset.

- **Type:** `null or Kubernetes quantity, such as "500m" or "1Gi" (a non-negative decimal or integer with an optional suffix m, k, M, G, T, P, E, Ki, Mi, Gi, Ti, Pi or Ei)`
- **Default:** `null`

### `resources.limits.memory`

The memory quantity. Null leaves it unset.

- **Type:** `null or Kubernetes quantity, such as "500m" or "1Gi" (a non-negative decimal or integer with an optional suffix m, k, M, G, T, P, E, Ki, Mi, Gi, Ti, Pi or Ei)`
- **Default:** `"1Gi"`

### `resources.requests`

Resource quantities by name.

- **Type:** `open submodule of attribute set of Kubernetes quantity, such as "500m" or "1Gi" (a non-negative decimal or integer with an optional suffix m, k, M, G, T, P, E, Ki, Mi, Gi, Ti, Pi or Ei)`
- **Default:** `{ }`

### `resources.requests.cpu`

The cpu quantity. Null leaves it unset.

- **Type:** `null or Kubernetes quantity, such as "500m" or "1Gi" (a non-negative decimal or integer with an optional suffix m, k, M, G, T, P, E, Ki, Mi, Gi, Ti, Pi or Ei)`
- **Default:** `"100m"`

### `resources.requests.ephemeral-storage`

The ephemeral-storage quantity. Null leaves it unset.

- **Type:** `null or Kubernetes quantity, such as "500m" or "1Gi" (a non-negative decimal or integer with an optional suffix m, k, M, G, T, P, E, Ki, Mi, Gi, Ti, Pi or Ei)`
- **Default:** `null`

### `resources.requests.memory`

The memory quantity. Null leaves it unset.

- **Type:** `null or Kubernetes quantity, such as "500m" or "1Gi" (a non-negative decimal or integer with an optional suffix m, k, M, G, T, P, E, Ki, Mi, Gi, Ti, Pi or Ei)`
- **Default:** `"128Mi"`

### `settings`

grafana.ini sections and keys, merged over the package defaults. The
package disables calls to grafana.com (`analytics.reporting_enabled`,
`analytics.check_for_updates`, `analytics.check_for_plugin_updates`,
`plugins.public_key_retrieval_disabled`, `plugins.preinstall_disabled`,
and `news.news_feed_enabled`), sets `log.mode = "console"`, sets data
proxy timeouts, and sets `server.root_url` from the route. A null value
removes a key. The `paths` section, `server.http_port`,
`security.admin_user`, and `security.admin_password` are refused because
the mounts, Service, and `grafanaAdmin` dependency own them. Pass
credentials through `env` (`secretKeyRef`) or `$__file{...}` rather than
writing them into this ConfigMap.

- **Type:** `attribute set of attribute set of (null or boolean or signed integer or floating point number or string)`
- **Default:** `{ }`
- **Example:**

  ```nix
  {
    "auth.generic_oauth" = {
      client_id = "grafana";
      enabled = true;
    };
    server = {
      root_url = "https://grafana.example.com";
    };
  }
  ```

### `sidecar.dashboards.enabled`

Run the k8s-sidecar container that loads dashboards from labelled ConfigMaps or Secrets.

- **Type:** `boolean`
- **Default:** `true`

### `sidecar.dashboards.label`

Label key that marks a ConfigMap or Secret as holding dashboards.

- **Type:** `non-empty string`
- **Default:** `"grafana_dashboard"`

### `sidecar.dashboards.labelValue`

Value of `label` that the sidecar matches.

- **Type:** `string`
- **Default:** `"1"`

### `sidecar.dashboards.searchNamespace`

Namespace the sidecar searches (k8s-sidecar's NAMESPACE): `ALL` or one namespace name. Null leaves NAMESPACE unset, so the sidecar searches Grafana's own namespace.

- **Type:** `null or non-empty string`
- **Default:** `"ALL"`

### `sidecar.datasources.enabled`

Run the k8s-sidecar container that loads datasources from labelled ConfigMaps or Secrets.

- **Type:** `boolean`
- **Default:** `true`

### `sidecar.datasources.label`

Label key that marks a ConfigMap or Secret as holding datasources.

- **Type:** `non-empty string`
- **Default:** `"grafana_datasource"`

### `sidecar.datasources.labelValue`

Value of `label` that the sidecar matches.

- **Type:** `string`
- **Default:** `"1"`

### `sidecar.datasources.searchNamespace`

Namespace the sidecar searches (k8s-sidecar's NAMESPACE): `ALL` or one namespace name. Null leaves NAMESPACE unset, so the sidecar searches Grafana's own namespace.

- **Type:** `null or non-empty string`
- **Default:** `null`

### `sidecar.image`

Image for the k8s-sidecar containers that load dashboards and datasources from labelled ConfigMaps and Secrets.

- **Type:** `submodule`
- **Default:**

  ```nix
  {
    digest = "sha256:52d311dcedd587421a236c4d6c621f05614c40a51386e955e0699dca97ec0880";
    pullPolicy = "IfNotPresent";
    repository = "quay.io/kiwigrid/k8s-sidecar";
    tag = "2.14.3";
  }
  ```

### `sidecar.image.digest`

Resolved manifest digest, `sha256:` followed by 64 hex characters. What will actually run. Null means not resolved.

- **Type:** `null or string`
- **Default:** the package's digest while `tag` is the package's tag, otherwise null

### `sidecar.image.note`

Whatever a person wanted to say about this pin. Kix never reads it and a promotion never discards it. Declared here for the same reason as the three fields above: a pin carries its own record-keeping, and the option accepts the whole pin rather than a subset of it.

- **Type:** `null or string`
- **Default:** `null`

### `sidecar.image.promotedBy`

Who resolved this pin, for the record. Null when unknown.

- **Type:** `null or string`
- **Default:** `null`

### `sidecar.image.pullPolicy`

imagePullPolicy for containers using this image. Null leaves it to Kubernetes.

- **Type:** `null or string`
- **Default:** `"IfNotPresent"`

### `sidecar.image.repository`

Image repository, registry host included.

- **Type:** `string`
- **Default:** `"quay.io/kiwigrid/k8s-sidecar"`

### `sidecar.image.resolvedAt`

When this pin was resolved, RFC 3339. Null when unknown.

- **Type:** `null or string`
- **Default:** `null`

### `sidecar.image.sourceRev`

Revision of the source the image was built from, when Kix built it. Null for upstream images.

- **Type:** `null or string`
- **Default:** `null`

### `sidecar.image.tag`

Image tag. What was asked for.

- **Type:** `string`
- **Default:** `"2.14.3"`

### `sidecar.resources`

Resources for each k8s-sidecar container.

- **Type:** `submodule`
- **Default:**

  ```nix
  {
    limits = {
      cpu = "100m";
      memory = "256Mi";
    };
    requests = {
      cpu = "50m";
      memory = "96Mi";
    };
  }
  ```

### `sidecar.resources.claims`

Dynamic resource claims the container uses. Null leaves it unset.

- **Type:** `null or (list of (submodule))`
- **Default:** `null`

### `sidecar.resources.claims.*.name`

Name of an entry in the pod's `resourceClaims`.

- **Type:** `string`

### `sidecar.resources.claims.*.request`

Request within the claim to use. Null uses the whole claim.

- **Type:** `null or string`
- **Default:** `null`

### `sidecar.resources.limits`

Resource quantities by name.

- **Type:** `open submodule of attribute set of Kubernetes quantity, such as "500m" or "1Gi" (a non-negative decimal or integer with an optional suffix m, k, M, G, T, P, E, Ki, Mi, Gi, Ti, Pi or Ei)`
- **Default:** `{ }`

### `sidecar.resources.limits.cpu`

The cpu quantity. Null leaves it unset.

- **Type:** `null or Kubernetes quantity, such as "500m" or "1Gi" (a non-negative decimal or integer with an optional suffix m, k, M, G, T, P, E, Ki, Mi, Gi, Ti, Pi or Ei)`
- **Default:** `"100m"`

### `sidecar.resources.limits.ephemeral-storage`

The ephemeral-storage quantity. Null leaves it unset.

- **Type:** `null or Kubernetes quantity, such as "500m" or "1Gi" (a non-negative decimal or integer with an optional suffix m, k, M, G, T, P, E, Ki, Mi, Gi, Ti, Pi or Ei)`
- **Default:** `null`

### `sidecar.resources.limits.memory`

The memory quantity. Null leaves it unset.

- **Type:** `null or Kubernetes quantity, such as "500m" or "1Gi" (a non-negative decimal or integer with an optional suffix m, k, M, G, T, P, E, Ki, Mi, Gi, Ti, Pi or Ei)`
- **Default:** `"256Mi"`

### `sidecar.resources.requests`

Resource quantities by name.

- **Type:** `open submodule of attribute set of Kubernetes quantity, such as "500m" or "1Gi" (a non-negative decimal or integer with an optional suffix m, k, M, G, T, P, E, Ki, Mi, Gi, Ti, Pi or Ei)`
- **Default:** `{ }`

### `sidecar.resources.requests.cpu`

The cpu quantity. Null leaves it unset.

- **Type:** `null or Kubernetes quantity, such as "500m" or "1Gi" (a non-negative decimal or integer with an optional suffix m, k, M, G, T, P, E, Ki, Mi, Gi, Ti, Pi or Ei)`
- **Default:** `"50m"`

### `sidecar.resources.requests.ephemeral-storage`

The ephemeral-storage quantity. Null leaves it unset.

- **Type:** `null or Kubernetes quantity, such as "500m" or "1Gi" (a non-negative decimal or integer with an optional suffix m, k, M, G, T, P, E, Ki, Mi, Gi, Ti, Pi or Ei)`
- **Default:** `null`

### `sidecar.resources.requests.memory`

The memory quantity. Null leaves it unset.

- **Type:** `null or Kubernetes quantity, such as "500m" or "1Gi" (a non-negative decimal or integer with an optional suffix m, k, M, G, T, P, E, Ki, Mi, Gi, Ti, Pi or Ei)`
- **Default:** `"96Mi"`

### `sidecar.sources.configMaps`

Load dashboards and datasources from ConfigMaps matching `sidecar.dashboards` and `sidecar.datasources` labels. Grants Grafana cluster-wide ConfigMap read access regardless of `searchNamespace`.

- **Type:** `boolean`
- **Default:** `true`

### `sidecar.sources.secrets`

Also load dashboards and datasources from labelled Secrets. Grants Grafana cluster-wide Secret read access; enable only when a datasource definition cannot read its credential from Grafana's environment.

- **Type:** `boolean`
- **Default:** `false`

### `tempoDatasource`

Name and uid of the Tempo datasource wired from the `tempo` dependency.

- **Type:** `submodule`
- **Default:** `{ }`

### `tempoDatasource.name`

Display name in the datasource picker.

- **Type:** `string`
- **Default:** `"Tempo"`

### `tempoDatasource.uid`

Stable identifier that dashboards refer to.

- **Type:** `string`
- **Default:** `"tempo"`