Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

(cli): cdk watch shows "...messages supressed..." logs infinitely #18451

Closed
tmokmss opened this issue Jan 15, 2022 · 2 comments · Fixed by #18486
Closed

(cli): cdk watch shows "...messages supressed..." logs infinitely #18451

tmokmss opened this issue Jan 15, 2022 · 2 comments · Fixed by #18486
Assignees
Labels
bug This issue is a bug. effort/small Small work item – less than a day of effort p1 package/tools Related to AWS CDK Tools or CLI

Comments

@tmokmss
Copy link
Contributor

tmokmss commented Jan 15, 2022

What is the problem?

Hi team, thank you very much for releasing the cool feature to monitor Lambda logs #18159!
I tried it and it's working fantastic, but noticed that it sometimes shows invalid logs infinitely. Details are below.

Could you check it when you get a chance? Thanks.

Reproduction Steps

Deploy a function with cdk watch, and invoke it.

What did you expect to happen?

Only valid logs are displayed.

What actually happened?

After several valid logs, ...messages supressed... logs continuously appears (say, 1 line per 2-3 seconds per function).

[/aws/lambda/BackendStack-Handler2AD178334-hzcv8uEytk3K] 1:08:39 PM REPORT RequestId: c680698d-dd1a-4c64-a387-a507203ad9ac      Duration: 493.33 ms      Billed Duration: 494 ms Memory Size: 128 MB     Max Memory Used: 79 MB
[/aws/lambda/BackendStack-Handler2AD178334-hzcv8uEytk3K] 1:08:39 PM (...messages supressed...)
[/aws/lambda/BackendStack-Handler1EB1BC6C8-StOYX6oimaCD] 1:08:38 PM (...messages supressed...)
[/aws/lambda/BackendStack-Handler1EB1BC6C8-StOYX6oimaCD] 1:08:38 PM (...messages supressed...)
[/aws/lambda/BackendStack-Handler1EB1BC6C8-StOYX6oimaCD] 1:08:38 PM (...messages supressed...)
[/aws/lambda/BackendStack-Handler1EB1BC6C8-StOYX6oimaCD] 1:08:38 PM (...messages supressed...)
[/aws/lambda/BackendStack-Handler1EB1BC6C8-StOYX6oimaCD] 1:08:38 PM (...messages supressed...)
[/aws/lambda/BackendStack-Handler2AD178334-hzcv8uEytk3K] 1:08:39 PM (...messages supressed...)
[/aws/lambda/BackendStack-Handler1EB1BC6C8-StOYX6oimaCD] 1:08:38 PM (...messages supressed...)
[/aws/lambda/BackendStack-Handler2AD178334-hzcv8uEytk3K] 1:08:39 PM (...messages supressed...)
[/aws/lambda/BackendStack-Handler1EB1BC6C8-StOYX6oimaCD] 1:08:38 PM (...messages supressed...)
[/aws/lambda/BackendStack-Handler2AD178334-hzcv8uEytk3K] 1:08:39 PM (...messages supressed...)
# ... continues infinitely

CDK CLI Version

2.8.0

Framework Version

2.8.0

Node.js Version

16

OS

macOS

Language

Typescript

Language Version

No response

Other information

Considering this document, there is a case that nextToken is returned but the response is empty.

This operation can return empty results while there are more log events available through the token.

Maybe we need to check the length of response.events here: (I'm not entirely sure though

// if we have > 100 events let the user know some
// messages have been supressed. We are essentially
// showing them a sampling (10000 events printed out is not very useful)
if (response.nextToken) {
events.push({
message: '(...messages supressed...)',
logGroupName,
timestamp: new Date(endTime),
});
}

@tmokmss tmokmss added bug This issue is a bug. needs-triage This issue or PR still needs to be triaged. labels Jan 15, 2022
@github-actions github-actions bot added the package/tools Related to AWS CDK Tools or CLI label Jan 15, 2022
@skinny85 skinny85 assigned corymhall and unassigned rix0rrr Jan 15, 2022
@peterwoodworth
Copy link
Contributor

We've put in a fix for this, should be merged shortly. Thanks for the bug report 🙂

@peterwoodworth peterwoodworth added effort/small Small work item – less than a day of effort p1 and removed needs-triage This issue or PR still needs to be triaged. labels Jan 18, 2022
@mergify mergify bot closed this as completed in #18486 Jan 19, 2022
mergify bot pushed a commit that referenced this issue Jan 19, 2022
Currently if `filterLogEvents` returns a nextToken then we print
`(...messages suppressed...)`. According to the docs "This operation
can return empty results while there are more log events available
through the token.".

This fix adds a condition to only print out the suppression message if
`filterLogEvents` returns non-empty results.

Also updates the message to be more descriptive.

fixes #18451


----

*By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license*
@github-actions
Copy link

⚠️COMMENT VISIBILITY WARNING⚠️

Comments on closed issues are hard for our team to see.
If you need more assistance, please either tag a team member or open a new issue that references this one.
If you wish to keep having a conversation with other community members under this issue feel free to do so.

TikiTDO pushed a commit to TikiTDO/aws-cdk that referenced this issue Feb 21, 2022
)

Currently if `filterLogEvents` returns a nextToken then we print
`(...messages suppressed...)`. According to the docs "This operation
can return empty results while there are more log events available
through the token.".

This fix adds a condition to only print out the suppression message if
`filterLogEvents` returns non-empty results.

Also updates the message to be more descriptive.

fixes aws#18451


----

*By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license*
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug This issue is a bug. effort/small Small work item – less than a day of effort p1 package/tools Related to AWS CDK Tools or CLI
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants