Skip to content
betterstack-alchemyUnofficial

Incidents.GoogleMonitoringIntegration

Kind ResourceType id BetterStack.Incidents.GoogleMonitoringIntegrationSource src/Incidents/GoogleMonitoringIntegration.tsLive test gated Lifecycle test runs against the offline mock; a live run exists but is gated behind BETTERSTACK_TEST_PAID_INTEGRATIONS=1 because the test account's plan refuses this integration (test/Incidents/GoogleMonitoringIntegration.test.ts).

Receives alerts from Google Cloud Monitoring and opens Better Stack incidents. Better Stack gives you a webhookUrl (a secret, Redacted): in Google Cloud, create a notification channel of type Webhooks with that URL and add it to your alerting policies. An open incident in Google Cloud opens one here, a closed one resolves it.

Every prop updates in place except teamId, which replaces the integration (and gives it a new webhookUrl). name defaults to a generated unique name. Removing escalationPolicyId or teamWait clears them. Without an escalation policy, call/sms/email/push/ criticalAlert decide how the current on-call person is alerted.

Creating a Google Cloud Monitoring integration

Section titled “Creating a Google Cloud Monitoring integration”

Alert through an escalation policy

const integration = yield* BetterStack.Incidents.GoogleMonitoringIntegration("google-monitoring", {
name: "Google Cloud Monitoring alerts",
escalationPolicyId: policyId,
});

Pasting the webhook URL into Google Cloud Monitoring

Section titled “Pasting the webhook URL into Google Cloud Monitoring”

The URL is a secret: export it from the stack and paste it into Google Cloud Monitoring, or hand it to whatever provisions Google Cloud Monitoring.

A stack output

const integration = yield* BetterStack.Incidents.GoogleMonitoringIntegration("alerts", { escalationPolicyId: policyId });
return { webhookUrl: integration.webhookUrl };

Stop opening incidents during maintenance

yield* BetterStack.Incidents.GoogleMonitoringIntegration("google-monitoring", { name: "Google Cloud Monitoring alerts", paused: true });

call boolean

Whether to call the on-call person. Ignored while an escalation policy is set.

criticalAlert boolean

Whether to send a critical push notification that ignores the mute switch and Do Not Disturb mode. Ignored while an escalation policy is set.

email boolean

Whether to send an e-mail to the on-call person. Ignored while an escalation policy is set.

escalationPolicyId string | null

ID of the escalation policy for alerts, or null to alert the current on-call person directly.

name string

Integration name. Defaults to a unique name generated from the stack, stage and logical id.

paused boolean

Whether the integration is paused. A paused integration opens no incidents.

push boolean

Whether to send a push notification to the on-call person. Ignored while an escalation policy is set.

recoveryPeriod number | null

Seconds a resolved alert must hold before the incident resolves. Has no effect for this integration, since an incident resolves as soon as Google Monitoring reports the alert as resolved.

sms boolean

Whether to send an SMS to the on-call person. Ignored while an escalation policy is set.

teamId string

Team that owns the resource, such as t123. Defaults to the credentials' team (BETTERSTACK_TEAM_ID, or the profile's team). Changing it replaces the resource.

teamWait number | null

Seconds to wait before escalating to the whole team. 0 alerts the whole team right away, and null never escalates to the team. Ignored while an escalation policy is set.

id string always set

The incidents_google_monitoring_integration's id.

call boolean

Whether to call the on-call person. Ignored while an escalation policy is set.

criticalAlert boolean

Whether to send a critical push notification that ignores the mute switch and Do Not Disturb mode. Ignored while an escalation policy is set.

email boolean

Whether to send an e-mail to the on-call person. Ignored while an escalation policy is set.

escalationPolicyId string | null

ID of the escalation policy for alerts, or null to alert the current on-call person directly.

name string | null

Integration name.

paused boolean

Whether the integration is paused. A paused integration opens no incidents.

push boolean

Whether to send a push notification to the on-call person. Ignored while an escalation policy is set.

recoveryPeriod number | null

Seconds a resolved alert must hold before the incident resolves. Has no effect for this integration, since an incident resolves as soon as Google Monitoring reports the alert as resolved.

sms boolean

Whether to send an SMS to the on-call person. Ignored while an escalation policy is set.

teamId string

Team that owns this integration, such as t123.

teamName string

Name of the team that owns this integration.

teamWait number | null

Seconds to wait before escalating to the whole team. 0 alerts the whole team right away, and null never escalates to the team. Ignored while an escalation policy is set.

webhookUrl string | Redacted<string>

The URL to paste into Google Monitoring. Alerts Google Monitoring sends to it open incidents.

GoogleMonitoringIntegration.lookup(props) reads an object this stack does not manage. It is never created, updated or deleted.

id string required

The integration's id.

teamId string

Team that owns it, such as t123. Defaults to the credentials' team.