Closed chrisghill closed 1 year ago
Massdriver must ingest the metric name when a package alarm is created in order to display metrics for package alarms in the UI. There will be a new field on the package_alarm_created called metric that should be stored with the package alarm. In order to do this the massdriver provider will have to provide additional details in the message being consumed by the platform. Additional Context: [https://massdriver.slab.com/posts/package-alarm-metadata-pd447muw](https://massdriver.slab.com/posts/package-alarm-metadata-pd447muw) new fields: namespace (aws, azure) - The monitoring namespace for the metric name - the name of the metric statistic - aggregation method i.e. SUM, AVERAGE, etc dimensions (aws) - The search criteria for the metric in cloudwatch
Honestly, 80% of the work here was getting the local dev environment working. I've included the changes it took for me to be able to run
make testacc
.I've added a
metric
block to the package alarms resource, with a maximum blocks of 1 (we can add more if needed for complex metric queries). You can see an example block in the test code, but it looks like this:This will produce a JSON payload that looks very similar:
The remaining questions I have are 1) which fields should be
required
(I took my best guess) and 2) which fields should beForceNew
(this triggers a delete + create instead of an update if changed).