Skip to content

Commit

Permalink
fix: avoid noisy dashboard diffs with custom monitoring (#60)
Browse files Browse the repository at this point in the history
Avoids noisy diffs when doing `cdk diff`, e.g.:

```
Resources
[~] AWS::CloudWatch::Dashboard Monitoring/Dashboards/Dashboard MonitoringDashboardsDashboard7D19B914
 └─ [~] DashboardBody
     └─ [~] .Fn::Join:
         └─ @@ -1,7 +1,7 @@
            [ ] [
            [ ]  "",
            [ ]  [
            [-]    "{\"start\":\"-P7D\",\"periodOverride\":\"inherit\",\"widgets\":[{\"type\":\"text\",\"width\":24,\"height\":2,\"x\":0,\"y\":0,\"properties\":{\"markdown\":\"| Info\\n|---\\n| AWS / Lambda / Test\"}},{\"type\":\"text\",\"width\":24,\"height\":1,\"x\":0,\"y\":2,\"properties\":{\"markdown\":\"# Custom metrics\"}},{\"type\":\"text\",\"width\":24,\"height\":1,\"x\":0,\"y\":3,\"properties\":{\"markdown\":\"### Test-CDK\"}},{\"type\":\"text\",\"width\":24,\"height\":1,\"x\":0,\"y\":4,\"properties\":{\"markdown\":\"? My custom monitor on some metrics\"}},{\"type\":\"metric\",\"width\":24,\"height\":5,\"x\":0,\"y\":5,\"properties\":{\"view\":\"timeSeries\",\"title\":\"My metric\",\"region\":\"",
            [+]    "{\"start\":\"-P7D\",\"periodOverride\":\"inherit\",\"widgets\":[{\"type\":\"text\",\"width\":24,\"height\":2,\"x\":0,\"y\":0,\"properties\":{\"markdown\":\"| Info\\n|---\\n| AWS / Lambda / Test\"}},{\"type\":\"text\",\"width\":24,\"height\":1,\"x\":0,\"y\":2,\"properties\":{\"markdown\":\"# Custom metrics\"}},{\"type\":\"text\",\"width\":24,\"height\":1,\"x\":0,\"y\":3,\"properties\":{\"markdown\":\"### Test-CDK\"}},{\"type\":\"text\",\"width\":24,\"height\":1,\"x\":0,\"y\":4,\"properties\":{\"markdown\":\"▼ My custom monitor on some metrics\"}},{\"type\":\"metric\",\"width\":24,\"height\":5,\"x\":0,\"y\":5,\"properties\":{\"view\":\"timeSeries\",\"title\":\"My metric\",\"region\":\"",
            [ ]    {
            [ ]      "Ref": "AWS::Region"
            [ ]    },
```
  • Loading branch information
echeung-amzn authored Mar 8, 2022
1 parent ea7d4a2 commit 68d6d68
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lib/monitoring/custom/CustomMonitoring.ts
Original file line number Diff line number Diff line change
Expand Up @@ -290,7 +290,7 @@ export class CustomMonitoring extends Monitoring {
rows.push(
new Row(
this.createDescriptionWidget(
`▼ ${this.description}`,
this.description,
this.descriptionWidgetHeight
)
)
Expand Down

0 comments on commit 68d6d68

Please sign in to comment.