-
Notifications
You must be signed in to change notification settings - Fork 4k
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
(CDK watch): stream cloudwatch logs of hotswapped resources #18122
Comments
I think this is definitely the way we want to go here. If we later extract this functionality to be more generic, so that it can be used outside For now, let's focus on making it
I believe you can also set a custom Log Group for a Function, so you probably need to handle them similarly to how you suggest doing it for ECS services below:
I think it's fine if the initial version streams logs from all resources in the application if that makes the solution simpler - remember that things generally only get logged when you call the underlying service, so there shouldn't be that many logs to trawl through (and it if turns out there are, we can always iterate on the experience later).
If the StateMachine logs to CloudWatch, then that would be a great start (I assume its logs also include some logs about the individual Tasks inside the machine). Logs for the individual Tasks in the State Machine would be fantastic, but I assume so complex, that it would have to be done in a separate PR. However, I think it's fine if the initial PR for this feature included only Lambda support, and then we handled supporting other resource types (ECS Services, StepFunction State Machines, etc.) in follow-up tasks.
We could, but that's a pretty "meh" experience. I would at least use the name of the resource, instead of the name of the Log Group. But I wouldn't include this option in the initial version of the feature. |
…18159) This adds a new `--logs` flag on `cdk watch` which is set to `true` by default. Watch will monitor all CloudWatch Log groups in the application and stream the log events back to the users terminal. re #18122 ---- *By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license*
|
…ws#18159) This adds a new `--logs` flag on `cdk watch` which is set to `true` by default. Watch will monitor all CloudWatch Log groups in the application and stream the log events back to the users terminal. re aws#18122 ---- *By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license*
Description
It would be amazing if running
cdk watch
would trace the logs of the deployed Lambda Function/ECS Service/... directly into the customer's console, without the need for going to CloudWatch.Use Case
The use case here is if I am using
cdk watch
to iterate on code changes to a Lambda Function (or ECS service, etc) I want to be able to view the logs from that Function directly in my terminal. This will help in debugging my application without having to navigate to the CloudWatch logs console.Proposed Solution
There are a couple different ways we could go about implementing this feature. Should this be a
watch
specific feature, or a general logs feature similar tosam logs
? Suppose we had a CDK application that had 10 different Lambda Functions. When we runcdk watch
what do we want to happen?Solution 1 -
watch
specific feature:In this solution we only want to stream logs for the resources that are being hotswapped. So in our above example, if we had 10 Lambda functions and we make a change to 1 Function, we should only see the logs for that 1 function.
cdk watch
Other Solutions
We could also stream all logs from all hotswappable resources in the application, but this could become too verbose.
Alternatively we could ask the user for input on which CloudWatch log groups to monitor, i.e.
Other information
No response
Acknowledge
The text was updated successfully, but these errors were encountered: