|
| 1 | +Google Managed Alertmanager |
| 2 | +=========================== |
| 3 | + |
| 4 | +This guide shows how to forward alerts from Google Managed Prometheus (GMP) managed Alertmanager to Robusta using Robusta's generic Alertmanager webhook. |
| 5 | + |
| 6 | +.. note:: |
| 7 | + |
| 8 | + Every alert must carry a ``cluster_name`` label. Set it to the Robusta ``cluster_name`` configured for the target cluster, or use ``external`` when the alerts do not belong to a specific runner. |
| 9 | + |
| 10 | + For configuring metric querying from Google Managed Prometheus, see :doc:`/configuration/metric-providers-google`. For other Alertmanager integrations, see :doc:`outofcluster-prometheus` or :doc:`alert-manager`. |
| 11 | + |
| 12 | +Requirements |
| 13 | +************ |
| 14 | + |
| 15 | +- Robusta ``account_id`` and ``signing_key`` from your ``generated_values.yaml`` file. |
| 16 | +- A GMP workspace with managed Alertmanager enabled. |
| 17 | + |
| 18 | +Configure the Alertmanager webhook |
| 19 | +********************************** |
| 20 | + |
| 21 | +Apply the following Secret in the GMP namespace (default ``gmp-public``). Replace ``<ACCOUNT_ID>`` and ``<SIGNING_KEY>`` with your credentials. |
| 22 | + |
| 23 | +.. code-block:: yaml |
| 24 | +
|
| 25 | + apiVersion: v1 |
| 26 | + kind: Secret |
| 27 | + metadata: |
| 28 | + name: alertmanager |
| 29 | + namespace: gmp-public |
| 30 | + type: Opaque |
| 31 | + stringData: |
| 32 | + alertmanager.yaml: | |
| 33 | + receivers: |
| 34 | + - name: 'robusta' |
| 35 | + webhook_configs: |
| 36 | + - url: 'https://api.robusta.dev/integrations/generic/alertmanager' |
| 37 | + http_config: |
| 38 | + authorization: |
| 39 | + # Replace with "<ACCOUNT_ID> <SIGNING_KEY>" |
| 40 | + credentials: '<ACCOUNT_ID> <SIGNING_KEY>' |
| 41 | + send_resolved: true |
| 42 | +
|
| 43 | + route: |
| 44 | + receiver: 'robusta' |
| 45 | + group_by: ['...'] |
| 46 | + group_wait: 1s |
| 47 | + group_interval: 1s |
| 48 | + repeat_interval: 4h |
| 49 | +
|
| 50 | +Ensure alerts include ``cluster_name`` |
| 51 | +************************************* |
| 52 | + |
| 53 | +Use an ``OperatorConfig`` to add external labels to both collection and rule evaluation so every alert contains the required ``cluster_name`` label. |
| 54 | + |
| 55 | +.. code-block:: yaml |
| 56 | +
|
| 57 | + apiVersion: monitoring.googleapis.com/v1 |
| 58 | + kind: OperatorConfig |
| 59 | + metadata: |
| 60 | + name: config |
| 61 | + namespace: gmp-public |
| 62 | + collection: |
| 63 | + externalLabels: |
| 64 | + cluster_name: gmp-demo-cluster # Match your Robusta cluster_name, or use "external" |
| 65 | + location: us-central1-c |
| 66 | + project_id: my-gcp-project |
| 67 | + rules: |
| 68 | + externalLabels: |
| 69 | + cluster_name: gmp-demo-cluster |
| 70 | + location: us-central1-c |
| 71 | + project_id: my-gcp-project |
| 72 | +
|
| 73 | +Deploy a demo alert |
| 74 | +******************* |
| 75 | + |
| 76 | +Create a simple alerting rule to confirm delivery to Robusta. |
| 77 | + |
| 78 | +.. code-block:: yaml |
| 79 | +
|
| 80 | + apiVersion: monitoring.googleapis.com/v1 |
| 81 | + kind: Rules |
| 82 | + metadata: |
| 83 | + name: test-alert |
| 84 | + namespace: gmp-public |
| 85 | + spec: |
| 86 | + groups: |
| 87 | + - name: test |
| 88 | + interval: 30s |
| 89 | + rules: |
| 90 | + - alert: TestAlertForGCPAlertmanager |
| 91 | + expr: vector(1) |
| 92 | + for: 0m |
| 93 | + labels: |
| 94 | + severity: warning |
| 95 | + annotations: |
| 96 | + summary: "Test alert to verify Alertmanager webhook" |
| 97 | + description: "This is a test alert. Delete the Rules resource to stop it." |
| 98 | +
|
| 99 | +Optional: verify credentials with curl |
| 100 | +************************************** |
| 101 | + |
| 102 | +You can manually validate the webhook and credentials by posting a sample alert: |
| 103 | + |
| 104 | +.. code-block:: bash |
| 105 | +
|
| 106 | + curl -X POST 'https://api.robusta.dev/integrations/generic/alertmanager' \ |
| 107 | + -H 'Authorization: Bearer <ACCOUNT_ID> <SIGNING_KEY>' \ |
| 108 | + -H 'Content-Type: application/json' \ |
| 109 | + -d '{ |
| 110 | + "externalURL": "https://console.cloud.google.com/monitoring", |
| 111 | + "groupKey": "gmp/test-alert:gmp-webhook-test-001", |
| 112 | + "version": "1", |
| 113 | + "status": "firing", |
| 114 | + "receiver": "robusta", |
| 115 | + "alerts": [ |
| 116 | + { |
| 117 | + "status": "firing", |
| 118 | + "startsAt": "2026-01-13T13:30:50Z", |
| 119 | + "endsAt": "1970-01-01T00:00:00Z", |
| 120 | + "generatorURL": "https://console.cloud.google.com/monitoring", |
| 121 | + "source": "GMP", |
| 122 | + "description": "Test alert to verify GMP Alertmanager webhook configuration", |
| 123 | + "fingerprint": "gmp-test-alert-12345", |
| 124 | + "annotations": { |
| 125 | + "summary": "GMP Webhook Test Alert", |
| 126 | + "description": "If you see this in Robusta, the webhook URL and credentials are working correctly!" |
| 127 | + }, |
| 128 | + "labels": { |
| 129 | + "cluster_name": "external", |
| 130 | + "cluster": "external", |
| 131 | + "alertname": "GMP_WebhookTest", |
| 132 | + "severity": "warning", |
| 133 | + "namespace": "gmp-public", |
| 134 | + "source": "gmp-managed-alertmanager" |
| 135 | + } |
| 136 | + } |
| 137 | + ] |
| 138 | + }' |
| 139 | +
|
| 140 | +You should see the test alert in Robusta shortly after applying the resources or running the curl command. |
| 141 | + |
0 commit comments