mirror of https://github.com/buster-so/buster.git
slack and env for buster prod alerts
This commit is contained in:
parent
c0745bc0c2
commit
3821c0211a
|
@ -7,6 +7,8 @@ declare global {
|
|||
ENVIRONMENT: string;
|
||||
NODE_ENV?: 'development' | 'production' | 'test';
|
||||
BUSTER_URL: string;
|
||||
BUSTER_ALERT_CHANNEL_TOKEN?: string;
|
||||
BUSTER_ALERT_CHANNEL_ID?: string;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -211,6 +211,24 @@ export async function sendSlackNotification(
|
|||
slackMessage
|
||||
);
|
||||
|
||||
const busterChannelToken = process.env.BUSTER_ALERT_CHANNEL_TOKEN;
|
||||
const busterChannelId = process.env.BUSTER_ALERT_CHANNEL_ID;
|
||||
|
||||
//Step 6: Send Alert To Buster Channel
|
||||
if (busterChannelToken && busterChannelId) {
|
||||
const busterResult = await sendSlackMessage(
|
||||
busterChannelToken,
|
||||
busterChannelId,
|
||||
slackMessage
|
||||
);
|
||||
if (!busterResult.success) {
|
||||
logger.warn('Failed to send alert to Buster channel', {
|
||||
error: busterResult.error,
|
||||
channelId: busterChannelId,
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
if (result.success) {
|
||||
logger.log('Successfully sent Slack notification', {
|
||||
organizationId: params.organizationId,
|
||||
|
|
Loading…
Reference in New Issue