Skip to content

Api reference

components.alerting.public.commands

alert

execute_database_alerts

execute_database_alerts()

Check all database alerts

Source code in components/alerting/public/commands/alert.py
@alerting_commands.command(requires_authentication=False)
def execute_database_alerts() -> None:
    """
    Check all database alerts
    """
    from components.alerting.internal.business_logic.actions.alert import (
        execute_database_alerts as _execute_database_alerts,
    )

    _execute_database_alerts()

execute_datadog_alerts

execute_datadog_alerts()

Check all datadog alerts

Source code in components/alerting/public/commands/alert.py
@alerting_commands.command(requires_authentication=False)
def execute_datadog_alerts() -> None:
    """
    Check all datadog alerts
    """
    from components.alerting.internal.business_logic.actions.alert import (
        execute_datadog_alerts as _execute_datadog_alerts,
    )

    _execute_datadog_alerts()

execute_datadog_security_signals

execute_datadog_security_signals()

Check all datadog security signals

Source code in components/alerting/public/commands/alert.py
@alerting_commands.command(requires_authentication=False)
def execute_datadog_security_signals() -> None:
    """
    Check all datadog security signals
    """
    from components.alerting.internal.business_logic.actions.alert import (
        execute_datadog_security_signals as _execute_datadog_security_signals,
    )

    _execute_datadog_security_signals()

execute_turing_alerts

execute_turing_alerts()

Check all turing alerts

Source code in components/alerting/public/commands/alert.py
@alerting_commands.command(requires_authentication=False)
def execute_turing_alerts() -> None:
    """
    Check all turing alerts
    """
    from components.alerting.internal.business_logic.actions.alert import (
        execute_turing_alerts as _execute_turing_alerts,
    )

    _execute_turing_alerts()

app_group

alerting_commands module-attribute

alerting_commands = AppGroup('alerting')

components.alerting.public.config

ALERT_OWNER_TYPE_CONFIGS module-attribute

ALERT_OWNER_TYPE_CONFIGS = key_by(
    [
        AlertOwnerTypeConfig(
            owner_type=claims_eng,
            linear_team_id=LINEAR_CLAIM_MANAGEMENT_TEAM_ID,
            linear_label_id=LINEAR_ENG_ONCALL_LABEL_ID,
            set_sla=True,
            set_assignee=True,
            oncall_group_id="c6f195e7-97ea-422b-81cb-e1590eaeedfa",
        ),
        AlertOwnerTypeConfig(
            owner_type=be_claims_eng,
            linear_team_id="d082a240-cb82-4263-9e97-595c499bb9bd",
            linear_label_id=LINEAR_ENG_ONCALL_LABEL_ID,
            set_sla=True,
            set_assignee=True,
            oncall_group_id="c6f195e7-97ea-422b-81cb-e1590eaeedfa",
        ),
        AlertOwnerTypeConfig(
            owner_type=be_css,
            linear_team_id="ae99e1c1-5890-48aa-b94b-aaa4b781c7fb",
            linear_label_id=None,
            set_sla=True,
            set_assignee=True,
            oncall_group_id="b33c611b-f18a-4423-9819-9c1032ed411b",
        ),
        AlertOwnerTypeConfig(
            owner_type=claims_ops,
            linear_team_id="f00713d2-9b4b-4084-8cb4-128a184952fe",
            linear_label_id=None,
            set_sla=False,
            set_assignee=False,
            oncall_group_id="3108c43f-af41-4c6a-8c71-b7e8aedd0f6d",
            status_when_opened=triage,
        ),
        AlertOwnerTypeConfig(
            owner_type=civil_servant_css,
            linear_team_id="9147f735-6b38-48b0-b30b-cb5f8985b657",
            linear_label_id=None,
            set_sla=False,
            set_assignee=False,
        ),
        AlertOwnerTypeConfig(
            owner_type=infra_eng,
            linear_team_id="b43e41e1-36dc-4d5e-b6c4-d289a4aa5e40",
            linear_label_id="312875f3-d653-4222-87be-8499ed62ed9b",
            set_sla=True,
            set_assignee=True,
            oncall_group_id="ea888900-6825-4b25-b322-0e931d210c93",
        ),
        AlertOwnerTypeConfig(
            owner_type=dx_eng,
            linear_team_id="e709f9e0-a622-40bf-ae4e-f92c17167315",
            linear_label_id="312875f3-d653-4222-87be-8499ed62ed9b",
            set_sla=True,
            set_assignee=True,
            oncall_group_id="3ffdd5a1-215f-4263-bbe9-74d0331eade9",
        ),
        AlertOwnerTypeConfig(
            owner_type=member_life_cycle,
            linear_team_id="a1852c1e-57fb-4a23-b808-c8b7ff50a2d7",
            linear_label_id=LINEAR_ENG_ONCALL_LABEL_ID,
            set_sla=True,
            set_assignee=False,
        ),
        AlertOwnerTypeConfig(
            owner_type=affiliation_eng,
            linear_team_id="651266da-11b7-47f7-bebf-00203a8fc704",
            linear_label_id=LINEAR_ENG_ONCALL_LABEL_ID,
            set_sla=True,
            set_assignee=True,
            oncall_group_id="5c604784-b3ad-4b3f-b6ce-0d5c20926010",
        ),
        AlertOwnerTypeConfig(
            owner_type=affiliation_care,
            linear_team_id="c5caebd8-e12a-4d5f-9ae7-ef1eb347dceb",
            linear_label_id=None,
            set_sla=False,
            set_assignee=True,
            oncall_group_id="aca16e4e-ef8a-4f45-8b8f-3ed5362995d4",
        ),
        AlertOwnerTypeConfig(
            owner_type=contract_lifecycle_eng,
            linear_team_id="806dc0ff-e14a-482f-a54b-de6c480c505a",
            linear_label_id=LINEAR_ENG_ONCALL_LABEL_ID,
            set_sla=True,
            set_assignee=False,
            status_when_opened=triage,
        ),
        AlertOwnerTypeConfig(
            owner_type=contract_lifecycle_ops,
            linear_team_id="806dc0ff-e14a-482f-a54b-de6c480c505a",
            linear_label_id="a594db89-26e6-414b-a6a4-51c57bc66d52",
            set_sla=True,
            set_assignee=False,
            status_when_opened=triage,
        ),
        AlertOwnerTypeConfig(
            owner_type=billing_eng,
            linear_team_id="342b6487-4d8e-4e25-9d1e-6c48b2aa9e11",
            linear_label_id=None,
            set_sla=True,
            set_assignee=True,
            oncall_group_id="795be8b9-ad53-4d06-884c-dae82db41de5",
            status_when_opened=triage,
        ),
        AlertOwnerTypeConfig(
            owner_type=security,
            linear_team_id="1bf0d33c-9019-4ac6-ad15-03479c90e3f9",
            linear_label_id="d61e237b-f159-42e1-8c7d-60c3663683a4",
            set_sla=True,
            set_assignee=True,
            oncall_group_id="efccde79-8ae4-4221-a91a-cfcae5d10d3a",
            status_when_opened=triage,
        ),
        AlertOwnerTypeConfig(
            owner_type=data_oncall,
            linear_team_id="42b2a1cf-d19b-47ac-96f7-039bbf0656e7",
            linear_project_id="b8742e8a-49d2-470d-b615-c50cc27481ed",
            linear_label_id=None,
            set_sla=False,
            set_assignee=False,
        ),
        AlertOwnerTypeConfig(
            owner_type=testing,
            linear_team_id="201a79b2-97df-451f-b724-9d3dbc727513",
            linear_label_id=None,
            set_sla=False,
            set_assignee=False,
        ),
    ],
    key_fn=lambda config: owner_type,
)

AlertOwnerTypeConfig dataclass

AlertOwnerTypeConfig(
    owner_type,
    linear_team_id,
    linear_label_id,
    set_sla,
    set_assignee,
    linear_project_id=None,
    oncall_group_id=None,
    status_when_opened=StatusWhenOpenedEnum.todo,
)

Configures how Linear issues (aka tickets) are managed according to alert's owner type

linear_label_id instance-attribute

linear_label_id

Optional Linear label ID to add on Linear issues For example, useful to differentiate oncall tickets from others.

linear_project_id class-attribute instance-attribute

linear_project_id = None

Linear project UUID. Optional, if not set, the issue will be created at the team level πŸ’‘Tip: In Linear, Press ⌘ + K, Select "Developer: Copy Model UUI"

linear_team_id instance-attribute

linear_team_id

Linear team UUID. πŸ’‘Tip: In Linear, Press ⌘ + K, Select "Developer: Copy Model UUI"

oncall_group_id class-attribute instance-attribute

oncall_group_id = None

Only needed if set_assignee is True to get the current oncall person. Must be one of the ID of OncallGroupShift cf. https://home.alan.com/on-call β§‰

owner_type instance-attribute

owner_type

set_assignee instance-attribute

set_assignee

Automatically assign Linear issues to the current oncall person

set_sla instance-attribute

set_sla

Automatically set an SLA on ALL Linear issues created in the Linear team with the label (if set) Including those not created by the alerting system

status_when_opened class-attribute instance-attribute

status_when_opened = todo

Default status to set on Linear issues

LINEAR_ISSUE_SOURCE_TYPE_CONFIGS module-attribute

LINEAR_ISSUE_SOURCE_TYPE_CONFIGS = key_by(
    [
        LinearIssueSourceTypeConfig(
            source_type=ad_hoc,
            linear_label_id="34cc0a26-6776-41ae-82a0-266353b971f5",
            default_resolution_time_in_hours=5 * 24,
        ),
        LinearIssueSourceTypeConfig(
            source_type=database_alert,
            linear_label_id="22dc9773-4b03-488f-9741-f088c19dd121",
            default_resolution_time_in_hours=None,
        ),
        LinearIssueSourceTypeConfig(
            source_type=turing_alert,
            linear_label_id="8a5d073c-4ffe-41e0-96a1-6c133cc4725d",
            default_resolution_time_in_hours=None,
        ),
        LinearIssueSourceTypeConfig(
            source_type=datadog_alert,
            linear_label_id="4149c240-52f6-4303-8081-43ed772b00ec",
            default_resolution_time_in_hours=None,
        ),
        LinearIssueSourceTypeConfig(
            source_type=intercom_conversation,
            linear_label_id=LINEAR_INTERCOM_CONVERSATION_LABEL_ID,
            default_resolution_time_in_hours=3 * 24,
        ),
        LinearIssueSourceTypeConfig(
            source_type=datadog_security_signals,
            linear_label_id="f90f9a9e-5c61-402b-a177-39c734245380",
            default_resolution_time_in_hours=None,
        ),
    ],
    key_fn=lambda config: source_type,
)

LinearIssueSourceTypeConfig dataclass

LinearIssueSourceTypeConfig(
    source_type,
    linear_label_id,
    default_resolution_time_in_hours,
)

Configures how Linear issues (aka tickets) are managed according to source type

default_resolution_time_in_hours instance-attribute

default_resolution_time_in_hours

Default resolution time in hours for alerts created from this source type

linear_label_id instance-attribute

linear_label_id

Linear label ID to add on Linear issues

source_type instance-attribute

source_type

MAX_ALERTS_CREATED_PER_DEFINITION module-attribute

MAX_ALERTS_CREATED_PER_DEFINITION = 10

MAX_EXCESS_ALERTS_INSTANCE_IDS_DISPLAYED module-attribute

MAX_EXCESS_ALERTS_INSTANCE_IDS_DISPLAYED = 1000

ONCALL_LINEAR_ISSUE_STATE_NAME_WHEN_CLOSED module-attribute

ONCALL_LINEAR_ISSUE_STATE_NAME_WHEN_CLOSED = 'Done'

StatusWhenOpenedEnum

Bases: AlanBaseEnum

Enum for the default status to set on Linear issues when they are opened

todo class-attribute instance-attribute

todo = 'Todo'

triage class-attribute instance-attribute

triage = 'Triage'

components.alerting.public.entities

alert_owner_type

AlertOwnerType

Bases: AlanBaseEnum

Enum representing the different types of oncall issue owners.

affiliation_care class-attribute instance-attribute
affiliation_care = 'affiliation_care'
affiliation_eng class-attribute instance-attribute
affiliation_eng = 'affiliation_eng'
be_claims_eng class-attribute instance-attribute
be_claims_eng = 'be_claims_eng'
be_css class-attribute instance-attribute
be_css = 'be_css'
billing_eng class-attribute instance-attribute
billing_eng = 'billing_eng'
civil_servant_css class-attribute instance-attribute
civil_servant_css = 'civil_servant_css'
claims_eng class-attribute instance-attribute
claims_eng = 'claims_eng'
claims_ops class-attribute instance-attribute
claims_ops = 'claims_ops'
contract_lifecycle_eng class-attribute instance-attribute
contract_lifecycle_eng = 'contract_lifecycle_eng'
contract_lifecycle_ops class-attribute instance-attribute
contract_lifecycle_ops = 'contract_lifecycle_ops'
data_oncall class-attribute instance-attribute
data_oncall = 'data_oncall'
dx_eng class-attribute instance-attribute
dx_eng = 'dx_eng'
infra_eng class-attribute instance-attribute
infra_eng = 'infra_eng'
member_life_cycle class-attribute instance-attribute
member_life_cycle = 'member_life_cycle'
security class-attribute instance-attribute
security = 'security'
testing class-attribute instance-attribute
testing = 'testing'

alert_severity

AlertSeverity

Bases: AlanBaseEnum

Severity of alert - will also set Linear priority

critical class-attribute instance-attribute
critical = 'critical'
high class-attribute instance-attribute
high = 'high'
low class-attribute instance-attribute
low = 'low'
medium class-attribute instance-attribute
medium = 'medium'

alert_status

AlertStatus

Bases: AlanBaseEnum

Enum representing acceptable statuses for Alerts in this component.

error class-attribute instance-attribute
error = 'error'
ok class-attribute instance-attribute
ok = 'ok'

linear_issue_source_type

LinearIssueSourceType

Bases: AlanBaseEnum

The source type of an oncall issue

ad_hoc class-attribute instance-attribute
ad_hoc = 'ad_hoc'
database_alert class-attribute instance-attribute
database_alert = 'database_alert'
datadog_alert class-attribute instance-attribute
datadog_alert = 'datadog_alert'
datadog_security_signals class-attribute instance-attribute
datadog_security_signals = 'datadog_security_signals'
intercom_conversation class-attribute instance-attribute
intercom_conversation = 'intercom_conversation'
turing_alert class-attribute instance-attribute
turing_alert = 'turing_alert'