Skip to main content

GCP Integration

The GCP integration lets you send alerts from Google Cloud Platform into OpsiMate using webhook-based push notifications.

Instead of OpsiMate pulling alerts from GCP, your GCP alerting policies push alerts directly to OpsiMate.

Webhook URL​

Configure your GCP notification channel to send alerts to your OpsiMate server:

http://localhost:3001/api/v1/alerts/custom/gcp?api_token={your_api_token}

Replace {your_api_token} with the API token configured in your OpsiMate server.

API Token Configuration​

Where the API token comes from
  • With a config file (CONFIG_FILE points to an existing file): the token is security.api_token in config.yml, and the API_TOKEN environment variable is ignored. The shipped docker-compose.yml, the Helm chart and the all-in-one image all run this way. With docker-compose.yml and the all-in-one image, the default-config.yml they start from sets it to opsimate. The Helm chart's config.configYml does not set it, and its API_TOKEN secret is ignored, so on Helm add api_token under security in config.configYml.
  • Without a config file: the token comes from the API_TOKEN environment variable, and falls back to opsimate.

Change the default for anything that is not a demo. See Configuration.

Send the token in any of these ways:

  • the api_token query parameter: ?api_token=YOUR_TOKEN
  • the X-API-Token header: X-API-Token: YOUR_TOKEN
  • the Authorization header: Authorization: Bearer YOUR_TOKEN

Use the same value in the GCP webhook URL.

Setting Up the Webhook in GCP​

To send alerts from GCP to OpsiMate via webhook:

  1. In the Google Cloud Console, go to Monitoring → Alerting.
  2. Open Notification channels.
  3. Create or edit a Webhook notification channel.
  4. Set the Webhook URL to your OpsiMate endpoint, for example:
    • http://your-opsimate-host/api/v1/alerts/custom/gcp?api_token={your_api_token}
  5. Save the notification channel.
  6. Attach this webhook notification channel to the alerting policies you want to forward to OpsiMate.

What OpsiMate Shows for GCP Incidents​

Every webhook call GCP sends updates a single alert in OpsiMate, keyed by the GCP incident id:

GCP fieldWhere it shows up in OpsiMate
incident.incident_idThe alert id. Updates for the same incident always update the same alert.
incident.policy_nameThe alert name, or UNKNOWN if the policy has no name.
incident.summaryThe alert summary, or a default text if the incident has no summary.
incident.policy_user_labelsThe alert's tags. An owner label assigns the alert to that user if it has no owner yet.
incident.started_atThe alert start time (unix seconds or an ISO date; falls back to the time the webhook arrived).
incident.urlThe View incident button on the alert.
incident.documentation.contentA Documentation button, but only if the content is a plain http(s):// URL.

While the incident is open, the alert stays firing in the alerts table with the GCP integration icon. When GCP closes the incident, OpsiMate automatically resolves the alert, so it moves to the Resolved list (it is not archived).

A webhook payload without an incident object — or one missing incident_id, state, started_at or url — is rejected with HTTP 400.

Severity​

  • Add a user label named severity to the alerting policy (Policy → User labels), for example severity: critical.
  • Allowed values are critical, warning and info. Common synonyms (P1, error, high, disaster, low, ...) are mapped automatically, case-insensitive.
  • Unknown or missing values → warning.

Important Disclaimer​

GCP sends alerts via webhook only to publicly reachable HTTP endpoints.

  • If you are running OpsiMate locally (for example at http://localhost:3001), GCP cannot call this URL directly from the internet.
  • For production use, deploy OpsiMate behind a publicly accessible URL (or expose it securely via tunneling / reverse proxy) so that GCP can reach the webhook endpoint.

Once configured, alerts pushed from GCP will appear in the alerts table in OpsiMate with the GCP integration icon, so you can easily identify their source.