Skip to content

Commit ccf0065

Browse files
[ROB-2999] Alertmanager support for gcp (#1990)
* Alertmanager support for gcp * cr fix --------- Co-authored-by: Arik Alon <[email protected]>
1 parent 99038b0 commit ccf0065

File tree

4 files changed

+152
-1
lines changed

4 files changed

+152
-1
lines changed
Lines changed: 141 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,141 @@
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 <ACCOUNT_ID> <SIGNING_KEY>, with your account_id and signing_key
40+
credentials: 'Bearer <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+

docs/configuration/alertmanager-integration/google-managed-prometheus.rst

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,10 @@ Google Managed Prometheus Alerts
99

1010
This guide shows how to send alerts from `Google Managed Prometheus <https://cloud.google.com/stackdriver/docs/managed-prometheus>`_ to Robusta.
1111

12+
.. note::
13+
14+
**Using Google Managed Alertmanager?** For Google Managed Prometheus (GMP) managed Alertmanager, see the dedicated guide: :doc:`google-managed-alertmanager`
15+
1216
For configuring metric querying from Google Managed Prometheus, see :doc:`/configuration/metric-providers-google`.
1317

1418
Prerequisites

docs/configuration/index.rst

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,11 @@ Prometheus & AlertManager
4646
:link: alertmanager-integration/google-managed-prometheus
4747
:link-type: doc
4848

49+
.. grid-item-card:: :octicon:`pulse;1em;` Google Managed Alertmanager
50+
:class-card: sd-bg-light sd-bg-text-light
51+
:link: alertmanager-integration/google-managed-alertmanager
52+
:link-type: doc
53+
4954
.. grid-item-card:: :octicon:`pulse;1em;` Grafana - Self-Hosted
5055
:class-card: sd-bg-light sd-bg-text-light
5156
:link: alertmanager-integration/grafana-self-hosted

docs/configuration/metric-providers-google.rst

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -93,5 +93,6 @@ Next Steps
9393
----------
9494

9595
- Configure :doc:`alert routing </notification-routing/index>`
96-
- Set up :doc:`Google Cloud alerting integration </configuration/alertmanager-integration/google-managed-prometheus>`
96+
- Set up :doc:`Google Managed Alertmanager integration </configuration/alertmanager-integration/google-managed-alertmanager>` (recommended for GMP managed Alertmanager)
97+
- Set up :doc:`Google Cloud alerting integration </configuration/alertmanager-integration/google-managed-prometheus>` (legacy guide)
9798
- Learn about :doc:`common configuration options <metric-providers>`

0 commit comments

Comments
 (0)