如何将AWS ECS Fargate CloudWatch日志推向UI,以供用户查看其长期运行的任务实时日志

发布于 2025-02-07 08:56:22 字数 612 浏览 3 评论 0原文

我正在创建一个应用程序,其中长期运行的任务在ECS Fargate中被执行,并将日志推向CloudWatch。现在,正在寻找一种方法,使用户在UI中有能力在任务运行时查看这些实时实时日志。

我正在考虑以下方法。

  1. 在DynamoDB DynamoDB流中暂时保存日志
  2. 会触发lambda。
  3. Lambda将触发一个无数据源的AWS Appsync突变。
  4. 在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..

  1. Saving logs temporarily in DynamoDB
  2. DynamoDB stream with batch will trigger a lambda.
  3. Lambda will trigger an AWS Appsync mutation with None data source.
  4. 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 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

仅一夜美梦 2025-02-14 08:56:22

为什么不使用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.

Possible Architecture

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文