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

查看运行任务中的日志的功能 #1989

Open
rayn316 opened this issue Jun 12, 2024 · 6 comments
Open

查看运行任务中的日志的功能 #1989

rayn316 opened this issue Jun 12, 2024 · 6 comments

Comments

@rayn316
Copy link
Contributor

rayn316 commented Jun 12, 2024

What would you like to be added:
可以对运行稍微时间长的脚本判断当前运行情况

Why is this needed:
运行的任务有时候会比较久或者卡住,但是任务没有完成是看不到日志,不方便排查情况,后续是否会变成执行中也能查看日志?

@kongfei605
Copy link
Collaborator

有stdout 和 stderr ,要不脚本中多输出一些内容试试?

@rayn316
Copy link
Contributor Author

rayn316 commented Jun 13, 2024

未执行完成,是没有产生输出文件的 @kongfei605
只有在运行完成才有stdout 和 stderr
image
1

@UlricQin
Copy link
Member

最佳的做法是客户端和服务端直接建立 websocket 长连接,想看 categraf 内存里的任务的 stdout 和 stderr 的时候,直接通过 WebSocket 查看,不过这个工程就大了,得从长计议

@rayn316
Copy link
Contributor Author

rayn316 commented Jun 13, 2024

夜莺任务页面查看输出时,是从执行服务器categraf重新获取的,还是夜莺先缓存任务保存结果,直接从夜莺返回的?

@UlricQin
Copy link
Member

categraf 执行完了之后上报给夜莺,夜莺存到DB,用户查看的时候直接从DB获取的。这里也可以优化一下,让 categraf 每 5s 上报一次,即便没有执行完也上报,当然,带来的问题就是DB压力会比较大

@rayn316
Copy link
Contributor Author

rayn316 commented Jul 3, 2024

我们这边写了相关功能,要是运行一阵后没有问题会合并代码

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants