MDAA TS Docs
    Preparing search index...

    Alarm selection and evaluation timing shared by both notification targets of TokenUsageAlarmsProps.

    interface TokenUsageAlarmsCommonProps {
        accountTotal?: TokenThresholdsProps;
        datapointsToAlarm?: number;
        evaluationPeriods?: number;
        models?: NamedModelTokenAlarmProps;
        periodSeconds?: number;
    }

    Hierarchy (View Summary)

    Index

    Properties

    accountTotal?: TokenThresholdsProps

    Token-use alarms on the account-wide total across all model IDs.

    Use cases: overall token-spend alerting without enumerating models

    AWS: CloudWatch alarms on the undimensioned AWS/Bedrock InputTokenCount / OutputTokenCount

    Validation: Optional; TokenThresholdsProps

    datapointsToAlarm?: number

    Number of breaching periods within evaluationPeriods required to alarm (an "M of N" alarm).

    Use cases: ignoring a single burst while catching sustained token use

    AWS: CloudWatch alarm datapointsToAlarm

    Validation: Optional; Number; between 1 and evaluationPeriods

    evaluationPeriods
    

    integer

    1

    evaluationPeriods?: number

    Number of periods over which token use is compared to the threshold.

    Use cases: requiring sustained token use before alarming

    AWS: CloudWatch alarm evaluation periods

    Validation: Optional; Number; periodSeconds x evaluationPeriods at most 86400 for a period under 3600, at most 604800 otherwise

    1
    

    integer

    1

    Token-use alarms per model, keyed by a name for the model. Each entry lists every model and inference-profile ID callers use for that model.

    Use cases: per-model token-spend alerting

    AWS: CloudWatch alarms on AWS/Bedrock token metrics by ModelId

    Validation: Optional; NamedModelTokenAlarmProps

    periodSeconds?: number

    Alarm period in seconds. Each period's token count is compared to the threshold.

    Use cases: matching the alarm window to the token budget's granularity

    AWS: CloudWatch alarm period

    Bedrock publishes token metrics at one-minute resolution, so the period is a whole number of minutes.

    Validation: Optional; Number; multiple of 60; periodSeconds x evaluationPeriods at most 86400 for a period under 3600, at most 604800 otherwise

    300
    

    integer

    60

    60