Skip to content
betterstack-alchemyUnofficial

Errors.SlackIntegration

Kind ResourceType id BetterStack.Errors.SlackIntegrationSource src/Errors/SlackIntegration.tsOffline only Tested against the offline mock only: the lifecycle runs against the offline mock only (test/Errors/SlackIntegration.test.ts).

An Error tracking Slack integration: the Slack channel that gets error notifications, which errors reach it and how updates are posted.

The API cannot create or delete one: connect Slack in the Better Stack web app first (it needs Slack’s OAuth consent), then this resource takes over the integration named by integrationId and applies the settings you declare. Destroying the resource only forgets it; the integration and its settings stay in Better Stack. A missing integrationId fails the deploy.

applications and tagFilter are replaced as a whole on update; notifications changes only the toggles sent, and only the toggles you declare are compared with what the API answers.

Post new errors of one application to the channel, in threads

const errors = yield* BetterStack.Errors.Application("api-errors", {
platform: "bun_errors",
});
yield* BetterStack.Errors.SlackIntegration("slack", {
integrationId: "12345",
applications: [{ applicationId: errors.id, environments: ["production"] }],
postUpdates: "thread_based",
occurrenceThresholdCount: 50,
occurrenceThresholdInterval: "hour",
});

integrationId string required

The id of the Slack integration to take over: one connected in the Better Stack web app (Errors → Integrations → Slack), from List Slack integrations. Changing it takes over that integration instead; the previous one keeps its settings.

affectedUsersThresholdCount number

Total number of affected users for notifications.affected_users_threshold. A positive whole number.

aiSreOnMention boolean

Start an AI SRE conversation when Better Stack is tagged in the channel.

applications UpdateErrorsSlackIntegrationRequestApplicationsItem[]

Applications whose errors this integration posts, each with its environments. Empty means any application. An update replaces the whole list.

broadcastUpdates boolean

With thread_based, also send important updates to the channel. Important updates are resolved and re-opened errors, spikes, and errors reaching an occurrence milestone.

notifications ErrorsMicrosoftTeamsIntegrationNotifications

Which events post to the channel, as under Notify me when in the web app. An update changes only the toggles sent.

occurrenceThresholdCount number

Number of occurrences for notifications.occurrence_threshold. A positive whole number.

occurrenceThresholdInterval "minute" | "hour" | "day" | "week" | string

Time window for notifications.occurrence_threshold.

postUpdates "single_channel" | "thread_based" | string

How updates are posted to Slack.

tagFilter UpdateErrorsSlackIntegrationRequestTagFilterItem[]

The tags an error must have to be posted. An error matches when one of its exceptions has every tag listed, each set to one of the tag's values. Empty means every error. You can list up to 10 tags, each once, with up to 50 values each. A tag or value can be up to 200 characters. An update replaces the whole list. The new_releases and spike_protection notifications and state changes are posted whatever the tags.

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 errors_slack_integration's id.

affectedUsersThresholdCount number

Total number of affected users for notifications.affected_users_threshold. A positive whole number.

aiSreOnMention boolean

Start an AI SRE conversation when Better Stack is tagged in the channel.

applications UpdateErrorsSlackIntegrationRequestApplicationsItem[]

Applications whose errors this integration posts, each with its environments (ids as strings).

broadcastUpdates boolean

With thread_based, also send important updates to the channel. Important updates are resolved and re-opened errors, spikes, and errors reaching an occurrence milestone.

notifications ErrorsMicrosoftTeamsIntegrationNotifications

Which events post to the channel, as under Notify me when in the web app. An update changes only the toggles sent.

occurrenceThresholdCount number

Number of occurrences for notifications.occurrence_threshold. A positive whole number.

occurrenceThresholdInterval "minute" | "hour" | "day" | "week"

Time window for notifications.occurrence_threshold.

postUpdates "single_channel" | "thread_based"

How updates are posted to Slack.

slackChannelName string

Slack channel errors are posted to.

slackTeamName string

The Slack workspace the channel is in.

tagFilter ErrorsSlackIntegrationTagFilterItem[]

The tags an error must have to be posted. An error matches when one of its exceptions has every tag listed, each set to one of the tag's values. Empty means every error. You can list up to 10 tags, each once, with up to 50 values each. A tag or value can be up to 200 characters. An update replaces the whole list. The new_releases and spike_protection notifications and state changes are posted whatever the tags.

teamId string

ID of the team that owns the integration, such as t123.

teamName string

Name of the team that owns the integration.

SlackIntegration.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.