stacktape alarm export prints the alarm rules created in the Stacktape Console as entries for the alarms list of a resource in your configuration. The Console no longer creates or edits alarm rules. The old ones are listed under Legacy alarm rules on the Console's Alarms page and keep applying to every matching resource until you exclude or delete them.
The command needs a Console sign-in (stacktape login) and changes nothing. It only prints.
Usage
stacktape alarm exportThe output starts with how many rules it found. Each rule follows as a YAML list entry, with a comment that names the rule and the projects and stages it applies to:
# alarm "api-error-rate"# applies to projects: all · stages: production- trigger: type: lambda-error-rate properties: thresholdPercent: 5 notificationChannels: - type: console-channel properties: channelName: production-alertsThe Console channels a rule sent to become console-channel entries. When the organization has no Console rules, the command prints This organization has no Console-defined alarms. Nothing to export.
Moving the rules into your configuration
- Run
stacktape alarm export. - Add each entry to the
alarmslist of every resource it should watch. Where a rule applies only to some stages, use stage-based configuration. - On the same resources, add the rule's name to
disabledGlobalAlarms. Without it the Console rule keeps applying next to your new alarm, and the resource gets two alarms that notify twice. - Deploy each affected stage.
- Check the alarms on the Console's Alarms page or with
stacktape alarm list. Once every stack the rule applies to has deployed, delete the legacy rule in the Console.
For the api-error-rate rule above, the function's configuration looks like this:
resources: api: type: function properties: # ... alarms: - trigger: type: lambda-error-rate properties: thresholdPercent: 5 notificationChannels: - type: console-channel properties: channelName: production-alerts disabledGlobalAlarms: - api-error-rateAlarms explains the alarm settings.
Options
stacktape alarm export3 options-h, --helpstringShow Help
More about --help
If provided, the command will not execute and will instead print help information.
--log-level"info" | "debug" | "error"Log Level
More about --log-level
The level of logs to print to the console.
info: Basic information about the operation.error: Only errors.debug: Detailed information for debugging.
--quietbooleanQuiet
More about --quiet
Hide progress, banners, success messages and hints. Command output, warnings and errors are still printed.
Related commands
alarm listshows the state of the alarms of a deployed stack.deploycreates the alarms you added to the configuration.