aws / aws/aws-cdk

Cloudwatch: Support live data for SingleValueWidget in CloudWatch dashboards

Open
#36,915 3 comments 0 reactions 0 assignees View on GitHub
@aws-cdk/aws-cloudwatch effort/medium feature-request p2
Dominant language
TypeScript
Stars
12.9k
Forks
4.6k
Avg merge
2d 3h
Merged PRs (30d)
83

Description

### Describe the feature

Currently, the `SingleValueWidget` in CDK-defined CloudWatch dashboards does not support live or auto-refreshing data. This limits its usefulness for operational monitoring of key metrics (e.g., errors, throttles, queue depth). Other widget types support near-real-time updates, but SingleValue widgets cannot be configured for this behaviour via CDK.

### Use Case

I want to display a SingleValue widget on a dashboard that **updates automatically** to reflect near real-time metrics without manually refreshing the dashboard. For example:

```ts
import * as cloudwatch from 'aws-cdk-lib/aws-cloudwatch';
import * as cdk from 'aws-cdk-lib';

const dashboard = new cloudwatch.Dashboard(stack, 'MyDashboard');

dashboard.addWidgets(
new cloudwatch.SingleValueWidget({
metrics: [
new cloudwatch.Metric({
namespace: 'MyApp',
metricName: 'ErrorCount',
period: cdk.Duration.minutes(1),
}),
],
}),
);
```

Currently, this widget only shows a static snapshot of the metric, even if the dashboard refreshes.

### Proposed Solution

Allow `SingleValueWidget` to optionally display live or near-real-time data.

### Other Information

_No response_

### Acknowledgements

- [x] I may be able to implement this feature request
- [ ] This feature might incur a breaking change

### AWS CDK Library version (aws-cdk-lib)

2.237.1

### AWS CDK CLI version

2.1101.0

### Environment details (OS name and version, etc.)

Mac OS Sonoma

Contributor guide

Open the contributing guide

Research direction

Start at the SingleValueWidget entry point in the aws-cloudwatch library and compare how other widget types support live or near-real-time data. Identify the optional configuration needed for a live SingleValue widget and verify its rendered CloudWatch dashboard definition with the relevant widget tests; done means the setting is available through CDK and produces the expected dashboard behavior.

Written by the indexing model from the issue text.

Assessment

Tech stack
aws, typescript
Domain
cloud, observability-sre
Issue type
Feature
Difficulty
3/5
Estimated time
1-2 days
Activity status
Quiet
Clarity
Mostly clear
Newbie friendliness
55/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.