如何将AWS ECS Fargate CloudWatch日志推向UI,以供用户查看其长期运行的任务实时日志
我正在创建一个应用程序,其中长期运行的任务在ECS Fargate中被执行,并将日志推向CloudWatch。现在,正在寻找一种方法,使用户在UI中有能力在任务运行时查看这些实时实时日志。
我正在考虑以下方法。
- 在DynamoDB DynamoDB流中暂时保存日志
- 会触发lambda。
- Lambda将触发一个无数据源的AWS Appsync突变。
- 在UI中,客户端将订阅该突变以获取实时更新。 (取决于批处理大小,示例5批表示5个日志线)
https://aws.amazon.com/premuimsupport/knowledge-center/appsync-notify-subscriber-real time/
我还有其他我能想到的技术或方法吗?
I am creating an app where the long running tasks are getting executed in ECS Fargate and logs are getting pushed to CloudWatch. Now, am looking for a way to give the users an ability in the UI to see those realtime live logs while their tasks are running.
I am thinking of the below approach..
- Saving logs temporarily in DynamoDB
- DynamoDB stream with batch will trigger a lambda.
- Lambda will trigger an AWS Appsync mutation with None data source.
- In UI client will subscribed to that mutation to get real time updates. (depends on the batch size, example 5 batch means 5 logs lines )
https://aws.amazon.com/premiumsupport/knowledge-center/appsync-notify-subscribers-real-time/
Is there any other techniques or methods that i can think of?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
为什么不使用CloudWatch默认保存在S3存储桶能力中,然后添加SNS让客户选择他们想要拖延日志的主题。删除额外的动力学。
Why not use Cloudwatch default save in S3 bucket ability and add SNS to let clients choose which topic they want to trail the log. Removing extra DynamoDB.