Skip to content
betterstack-alchemyUnofficial

Incidents.Severity

Kind ResourceType id BetterStack.Incidents.SeveritySource src/Incidents/Severity.tsLive test gated Lifecycle test runs against the offline mock; a live run exists but is gated behind BETTERSTACK_TEST_ESCALATION_POLICIES=1 because the main lifecycle runs live, but the cases that need it are gated: escalation policies need a paid plan (test/Incidents/Severity.test.ts).

A Better Stack severity: a named alerting level, such as low or high, that sets how people are alerted (phone call, SMS, e-mail, push, critical alert) when an EscalationPolicy step uses it through its severityId. Creating a severity alerts nobody; only an incident escalated through a step that uses it does.

Every prop updates in place; teamId replaces the severity. name defaults to a generated unique name. Removing severityGroupId takes the severity out of its SeverityGroup. A severity referenced by a policy step can’t be deleted until the step changes, so delete the policy first (Alchemy does, when the policy references severity.id).

An e-mail-only severity for low-urgency alerts

const low = yield* BetterStack.Incidents.Severity("low", {
name: "Low",
email: true,
push: false,
sms: false,
call: false,
});

Page the on-call person with a critical alert

const critical = yield* BetterStack.Incidents.Severity("critical", {
name: "Critical",
call: true,
push: true,
criticalAlert: true,
});
yield* BetterStack.Incidents.EscalationPolicy("on-call", {
name: "On-call",
steps: [
{
type: "escalation",
waitBefore: 0,
severityId: critical.id,
stepMembers: [{ type: "current_on_call" }],
},
],
});

call boolean

Whether escalation policy steps with this severity alert people by phone call. Each person can override this in their own notification settings.

criticalAlert boolean

Whether escalation policy steps with this severity send a critical alert, a push notification that ignores the mute switch and Do Not Disturb mode.

email boolean

Whether escalation policy steps with this severity alert people by e-mail. Each person can override this in their own notification settings.

name string

The severity's name, unique within the team, ignoring case. Defaults to a unique name generated from the stack, stage and logical id.

push boolean

Whether escalation policy steps with this severity alert people by push notification. Each person can override this in their own notification settings.

severityGroupId string | null

The ID of the severity group this severity belongs to, or null when it's in none. Get the ID via List severity groups.

sms boolean

Whether escalation policy steps with this severity alert people by SMS. Each person can override this in their own notification settings.

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.

id string always set

The severity's id.

call boolean

Whether escalation policy steps with this severity alert people by phone call. Each person can override this in their own notification settings.

criticalAlert boolean

Whether escalation policy steps with this severity send a critical alert, a push notification that ignores the mute switch and Do Not Disturb mode.

email boolean

Whether escalation policy steps with this severity alert people by e-mail. Each person can override this in their own notification settings.

name string

The severity's name, unique within the team, ignoring case.

push boolean

Whether escalation policy steps with this severity alert people by push notification. Each person can override this in their own notification settings.

severityGroupId string | null

The ID of the severity group this severity belongs to, or null when it's in none. Get the ID via List severity groups.

sms boolean

Whether escalation policy steps with this severity alert people by SMS. Each person can override this in their own notification settings.

teamId string

Team that owns this severity, such as t123.

teamName string

Name of the team that owns this severity.

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

teamId string

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