# Send VictoriaMetrics and vmalert notifications to SREbox

> Keep VictoriaMetrics storage and vmalert evaluation, then deliver Alertmanager-compatible firing and recovery events to SREbox.

Use this pattern when VictoriaMetrics continues to store and query telemetry but SREbox manages the response. The supported path is **vmalert → Alertmanager-compatible notifier → Alertmanager webhook receiver → SREbox**. The SREbox endpoint is a webhook receiver; it is not an Alertmanager API endpoint, so do not set `-notifier.url` to the SREbox webhook URL.

## 1. Prepare SREbox

Create a rota and enabled escalation policy with at least one usable rota tier. Add an incoming integration in **On-call → Integrations**, select the policy and store the generated bearer key securely. Incoming paging requires an on-call eligible plan. There is no separate webhook integration fee; plan paging allowances still apply.

## 2. Connect vmalert to Alertmanager

Configure vmalert's `-notifier.url` to the Alertmanager service endpoint supported by your deployment. Keep your existing VictoriaMetrics data source and rule evaluation settings. Consult the official vmalert documentation for the notifier address format and flags for your installed version.

## 3. Configure Alertmanager to deliver to SREbox

Add an Alertmanager webhook receiver for the SREbox endpoint and route the desired alerts to it. Enable resolved notifications and use a protected bearer credential file:

```yaml
route:
  receiver: srebox

receivers:
  - name: srebox
    webhook_configs:
      - url: https://srebox.tech/api/oncall/incoming/INTEGRATION-ID/
        send_resolved: true
        http_config:
          authorization:
            type: Bearer
            credentials_file: /etc/alertmanager/secrets/srebox-webhook-key
```

Choose Alertmanager route matchers and grouping based on the teams and events that should page. Use separate receivers and SREbox integrations where alerts must reach different policies.

## Event mapping and recovery

Alertmanager-format alerts are processed individually. SREbox uses `fingerprint` as the external ID; it maps `labels.alertname`, severity, instance/host and summary/description into the incident. Repeated active firing deliveries update an existing incident. A resolved delivery with the same fingerprint resolves it and cancels pending pages. A fresh firing after resolution opens a new incident.

SREbox accepts at most 100 alerts and a 64 KB request body. Large labels can exceed that limit. Keep the webhook payload free of credentials and sensitive values. SREbox exposes an integration last-received timestamp and incident history, not a detailed webhook delivery log.

## Verify the full path

1. Confirm vmalert is healthy and connected to Alertmanager.
2. Trigger a controlled test rule and confirm Alertmanager's delivery result.
3. Confirm the incident appears in **On-call → Incidents** and the selected policy has active coverage.
4. Let the rule recover and confirm the resolved event closes the same incident.
5. Check acknowledgement, escalation timing and notification-provider credits before relying on the path.

Troubleshoot the HTTP response at Alertmanager: **404** usually indicates an endpoint/key mismatch or paused integration; **400** indicates invalid alert fields; **403** means on-call is unavailable on the plan; **409** indicates the policy/rota is unavailable; **413** means the body is too large. An incident without a page usually points to rota coverage, contact methods, provider configuration or plan allowance.

Official references: [VictoriaMetrics vmalert](https://docs.victoriametrics.com/vmalert/), [Alertmanager configuration](https://prometheus.io/docs/alerting/latest/configuration/).
