aws / aws/aws-cdk

DynamoDB: Validation error on Metric create

Open
#34,785 3 comments 0 reactions 0 assignees View on GitHub
@aws-cdk/aws-dynamodb bug effort/medium p2
Dominant language
TypeScript
Stars
12.9k
Forks
4.6k
Avg merge
1d 19h
Merged PRs (30d)
74

Description

### Describe the bug

Using the .NET CDK, I am trying to create an Alarm on the MetricSuccessfulRequestLatency for our Dynamo table.

Regardless of the different attempts used, It seems to always trigger the following error.

> System.Exception: ValidationError: `Operation` dimension must be passed for the `SuccessfulRequestLatency` metric

From the new TableV2 instance

> conversationsTable.MetricSuccessfulRequestLatency(); seems to cause the issue.

I've tried
> conversationsTable.MetricSuccessfulRequestLatency(new OperationsMetricOptions())
> conversationsTable.MetricSuccessfulRequestLatency(new SystemErrorsForOperationsMetricOptions())
and populating the operations array with one or more operations.

There is no "Operation" property to set.

### Regression Issue

- [ ] Select this option if this issue appears to be a regression.

### Last Known Working CDK Library Version

_No response_

### Expected Behavior

Metric created successfully and no validation errors

### Current Behavior

Validation exception which occurs on just cdk diff

### Reproduction Steps

var testTable = new TableV2(stack, "dyno", new TablePropsV2
{
PartitionKey = new Attribute
{
Name = "id",
Type = AttributeType.STRING
}
});
testTable.MetricSuccessfulRequestLatency();

### Possible Solution

_No response_

### Additional Information/Context

_No response_

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

2.201.0

### AWS CDK CLI version

2.1019.1 (build d758c9f)

### Node.js Version

v22.13.1

### OS

Windows

### Language

.NET

### Language Version

.NET 9

### Other information

_No response_

Contributor guide

Open the contributing guide

Research direction

Start by running the supplied .NET reproduction with aws-cdk-lib 2.201.0 and inspect the implementation of MetricSuccessfulRequestLatency and its metric option types. Trace how the SuccessfulRequestLatency dimensions are assembled, then verify with cdk diff that the metric is created without the missing Operation validation error.

Written by the indexing model from the issue text.

Assessment

Tech stack
aws, csharp, typescript
Domain
cloud, databases, observability
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.