Esempio n. 1
0
def build_notification_attachment(
        notification: BaseNotification,
        context: Mapping[str, Any]) -> Mapping[str, str]:
    footer = build_notification_footer(notification)
    return {
        "title": notification.get_title(),
        "text": context["text_description"],
        "mrkdwn_in": ["text"],
        "footer_icon": get_sentry_avatar_url(),
        "footer": footer,
        "color": LEVEL_TO_COLOR["info"],
    }
Esempio n. 2
0
def build_notification_attachment(
        notification: BaseNotification,
        context: Mapping[str, Any]) -> Mapping[str, str]:
    if isinstance(notification, AlertRuleNotification):
        return build_group_attachment(
            notification.group,
            notification.event,
            context["tags"],
            notification.rules,
            issue_alert=True,
        )

    footer = build_notification_footer(notification)
    return {
        "title": notification.get_title(),
        "text": context["text_description"],
        "mrkdwn_in": ["text"],
        "footer_icon": get_sentry_avatar_url(),
        "footer": footer,
        "color": LEVEL_TO_COLOR["info"],
    }