aws / aws/aws-cdk

(aws-logs): metricIncomingLogEvents not working

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

Description

### Describe the bug

The implementation uses the wrong metricName.
It uses: IncomingLogs
Correct: IncomingEventLogs
See: https://docs.aws.amazon.com/AmazonCloudWatch/latest/logs/CloudWatch-Logs-Monitoring-CloudWatch-Metrics.html

### Regression Issue

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

### Last Known Working CDK Library Version

_No response_

### Expected Behavior

metricIncomingLogEvents() uses IncomingEventLogs

### Current Behavior

metricIncomingLogEvents() uses IncomingLogs

### Reproduction Steps

Alarm has no datapoints:
```
const logGroup = new logs.LogGroup(this, 'MyLogGroup');
logGroup.metricIncomingLogEvents().createAlarm(stack, 'IncomingEventsPerInstanceAlarm', {
threshold: 1,
evaluationPeriods: 1,
});
```

### Possible Solution

```
public metricIncomingLogEvents(props?: cloudwatch.MetricOptions): cloudwatch.Metric {
return this.metric('IncomingEventLogs', props);
}
```

### Additional Information/Context

_No response_

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

2.1101.0

### AWS CDK CLI version

2.1101.0 (build 92af268)

### Node.js Version

22

### OS

Ubuntu

### Language

TypeScript

### Language Version

_No response_

### Other information

_No response_

Contributor guide

Open the contributing guide

Research direction

Start by locating the metricIncomingLogEvents() implementation in the aws-logs library and compare its metric name with the AWS CloudWatch Logs metrics documentation linked in the issue. Reproduce the alarm scenario or run the relevant existing tests, and consider the work complete when the method uses IncomingEventLogs and the alarm can receive datapoints.

Written by the indexing model from the issue text.

Assessment

Tech stack
aws, typescript
Domain
cloud, observability-sre
Issue type
Bug
Difficulty
2/5
Estimated time
1-3 hours
Activity status
Stale
Clarity
Clearly specified
Newbie friendliness
48/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.