Skip to content

Commit 82f980d

Browse files
chore: Update reamdme with scope monitoring (#42)
* chore: Update readme with scope monitoring
1 parent b514e71 commit 82f980d

File tree

3 files changed

+24
-2
lines changed

3 files changed

+24
-2
lines changed

API.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22558,7 +22558,7 @@ const monitoringAspectType: MonitoringAspectType = { ... }
2255822558

2255922559
---
2256022560

22561-
##### `enabled`<sup>Required</sup> <a name="enabled" id="cdk-monitoring-constructs.MonitoringAspectType.property.enabled"></a>
22561+
##### `enabled`<sup>Optional</sup> <a name="enabled" id="cdk-monitoring-constructs.MonitoringAspectType.property.enabled"></a>
2256222562

2256322563
```typescript
2256422564
public readonly enabled: boolean;

README.md

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -209,6 +209,28 @@ This is a general procedure on how to do it:
209209

210210
Both of these monitoring base classes are dashboard segments, so you can add them to your monitoring by calling `.addSegment()`.
211211

212+
### Monitoring Scopes
213+
214+
With CDK Monitoring Constructs, you can monitor complete CDK construct scopes. It will automatically discover all monitorable resources within the scope (recursively)) and add them to your dashboard.
215+
216+
```ts
217+
monitoring.monitorScope(stack);
218+
```
219+
220+
You can also specify default alarms for any specific resource and disable automatic monitoring for it as well.
221+
222+
```ts
223+
monitoring.monitorScope(stack, {
224+
lambda: {
225+
props: {
226+
addLatencyP50Alarm: {
227+
Critical: { maxLatency: Duration.seconds(10) },
228+
},
229+
},
230+
},
231+
billing: { enabled: false },
232+
});
233+
```
212234

213235
## Contributing/Security
214236

lib/facade/aspect-types.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ export interface MonitoringAspectType<T> {
3030
* If the monitoring aspect is enabled for this resource.
3131
* @default true
3232
*/
33-
readonly enabled: boolean;
33+
readonly enabled?: boolean;
3434

3535
/**
3636
* The monitoring props for this resource.

0 commit comments

Comments
 (0)