# victoria-metrics-alert

VictoriaMetrics alerting: VMAlert and VMAlertmanager

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

| | |
| --- | --- |
| Stability | Stable |
| `package` value | `packages.victoria-metrics-alert` |
| Default software version | `1.156.0` |
| Default aliases | `vmAlert` |

## How-to guides

- [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 |
| --- | --- |
| `vmCluster` | Required |
| `vmOperator` | Required |
| `alertmanagerConfig` | Optional |
| `prometheus` | Optional |

## Options

### `alertmanager.configMaps`

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

### `alertmanager.configRawYaml`

The Alertmanager configuration file, written into the CR's `configRawYaml` so that the package renders no configuration Secret. Same content and the same refusal of inline credentials as `settings`. Mutually exclusive with `settings` and the `alertmanagerConfig` dependency.

- **Type:** `null or (attribute set of anything)`
- **Default:** `null`

### `alertmanager.extraSpec`

Extra fields deep-merged into the VMAlertmanager CR spec. The package refuses `configSecret` and `configRawYaml`, which the configuration options and the `alertmanagerConfig` dependency decide, and `image`, `replicaCount`, `retention`, `storage`, `secrets`, `configMaps`, and `resources`, which have options of their own. Setting `topologySpreadConstraints` here replaces the default pod spread constraints set from the availability level.

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

### `alertmanager.image`

Alertmanager container image for the VMAlertmanager CR. It cannot take a digest: the operator reads the tag as a semantic version to choose feature flags.

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

  ```nix
  {
    digest = null;
    pullPolicy = null;
    repository = "quay.io/prometheus/alertmanager";
    tag = "v0.33.1";
  }
  ```

### `alertmanager.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

### `alertmanager.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`

### `alertmanager.image.promotedBy`

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

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

### `alertmanager.image.pullPolicy`

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

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

### `alertmanager.image.repository`

Image repository, registry host included.

- **Type:** `string`
- **Default:** `"quay.io/prometheus/alertmanager"`

### `alertmanager.image.resolvedAt`

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

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

### `alertmanager.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`

### `alertmanager.image.tag`

Image tag. What was asked for.

- **Type:** `string`
- **Default:** `"v0.33.1"`

### `alertmanager.replicaCount`

Number of VMAlertmanager replicas. Defaults from the cluster's
availability level.

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

### `alertmanager.resources`

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

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

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

### `alertmanager.resources.claims`

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

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

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

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

- **Type:** `string`

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

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

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

### `alertmanager.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:** `{ }`

### `alertmanager.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:** `null`

### `alertmanager.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`

### `alertmanager.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"`

### `alertmanager.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:** `{ }`

### `alertmanager.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"`

### `alertmanager.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`

### `alertmanager.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"`

### `alertmanager.retention`

- **Type:** `string`
- **Default:** `"120h"`

### `alertmanager.secrets`

Secrets mounted into Alertmanager pods (credentials referenced from config).

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

### `alertmanager.settings`

The Alertmanager configuration file, alertmanager.yaml (`global`, `route`, `receivers`, `inhibit_rules`, `templates`), rendered into a Secret the CR's `configSecret` names. A value replaces the package's configuration as a whole rather than merging into it, because the package's routing tree names its own `null` receiver. Null uses the package's configuration, which routes every alert to the receiver `null`. A credential written inline (`auth_password`, `routing_key`, `api_key`, a Slack `api_url`, and the like) is refused: take it from a file (`api_url_file`, `password_file`, `credentials_file`) mounted through `secrets`. Mutually exclusive with `configRawYaml` and the `alertmanagerConfig` dependency.

- **Type:** `null or (attribute set of anything)`
- **Default:** null: the package's configuration, which routes every alert to the receiver `null`

### `alertmanager.storage`

PVC spec for the alertmanager volumeClaimTemplate. null =
emptyDir: silences and the notification log survive single-pod
restarts via pair gossip, but a simultaneous restart (node
reboot) drops them. Set for anything beyond a trial.

- **Type:** `anything`
- **Default:** `null`

### `evaluationInterval`

- **Type:** `string`
- **Default:** `"30s"`

### `extraArgs`

vmalert flags for the VMAlert CR's `extraArgs`, keyed by flag name without the leading dash.

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

### `extraSpec`

Extra fields deep-merged into the VMAlert CR spec. The package refuses `datasource.url`, `remoteWrite.url`, `remoteRead.url`, and `notifiers`, which come from the vmCluster dependency and the alertmanager this package runs, and `image`, `replicaCount`, `evaluationInterval`, `selectAllByDefault`, `resources`, and `extraArgs`, which have options of their own. Setting `topologySpreadConstraints` here replaces the default pod spread constraints set from the availability level.

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

### `healthCheck.enabled`

Run the package's post-deploy probe (kix.healthCheck) once its resources are ready. A failing probe fails the deploy before the activation switches.

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

### `healthCheck.retryFor`

Seconds the probe keeps re-checking before it gives up, so a target still restarting from the rollout does not fail the deploy. The Job's deadline is sized from it.

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

### `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:4fea7d1a888d4db4ff18804434ef0f3ca8eb6482e289c50d32001c2db218287c";
    pullPolicy = null;
    repository = "docker.io/victoriametrics/vmalert";
    tag = "v1.156.0";
  }
  ```

### `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:** `null`

### `image.repository`

Image repository, registry host included.

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

### `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:** `"v1.156.0"`

### `metrics.enabled`

Render the package's alert rules when a `prometheus` dependency is present. The operator's scrape of the workload does not depend on it.

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

### `replicaCount`

Number of vmalert replicas. Defaults from the cluster's
availability level.

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

### `resources`

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

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

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

### `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:** `null`

### `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:** `"512Mi"`

### `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:** `"256Mi"`

### `selectAllByDefault`

Evaluate all VMRules (and converted PrometheusRules) cluster-wide.

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