aws / aws-cdk

The AWS Cloud Development Kit is a framework for defining cloud infrastructure in code
https://aws.amazon.com/cdk
Apache License 2.0
11.71k stars 3.93k forks source link

aws-log: [Minor improvement] add newline between each statement in CloudWatch Log Saved Query #22422

Open khaing211 opened 2 years ago

khaing211 commented 2 years ago

Describe the feature

Could someone add newline between each statement in CloudWatch Log Saved Query?

https://github.com/aws/aws-cdk/blob/v2.45.0/packages/@aws-cdk/aws-logs/lib/query-definition.ts#L105

This format makes this easy for someone to use because the query fits in the AWS Console code editor screen.

Use Case

I'm always frustrated when I have to scroll horizontally, in the code editor on CloudWatch Log Insight Query, to find my placeholder in the Saved Query.

Proposed Solution

No response

Other Information

No response

Acknowledgements

CDK version used

2.x

Environment details (OS name and version, etc.)

NA

indrora commented 2 years ago

I'm not sure I'm following what the use case here is... Can you explain some more?

khaing211 commented 2 years ago

We use this construct to save cloud watch query with place holder. Then, we go to aws console to execute the query by replace the placeholder with real value. For example, all logs related to userId X (x = real Id).

Now, when we go to aws console, the code editor shows a single (long) line. It would be nicer if line breaks to multiple lines. Make sense?

On Tue, Nov 15, 2022 at 4:20 PM Morgan Gangwere @.***> wrote:

I'm not sure I'm following what the use case here is... Can you explain some more?

— Reply to this email directly, view it on GitHub https://github.com/aws/aws-cdk/issues/22422#issuecomment-1316072152, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAFJBQMK7TDY2BPZTJMSV33WIQSFFANCNFSM6AAAAAAQ72NHNM . You are receiving this because you authored the thread.Message ID: @.***>

-- Khai Nguyen

jerry-shao commented 2 years ago

Hi @madeline-k ,

I have raised a PR to improve the readability of Logs Insights Query Definition for this issue: https://github.com/aws/aws-cdk/pull/23094 Any chance you could have a look?

Thanks!

jerry-shao commented 5 months ago

Hi @pahud

This issue has been resolve by this PR: https://github.com/aws/aws-cdk/pull/23094

I think we can resolve this issue now.