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

如何在server端打印出correlation_id? #2900

Open
whatausernameis opened this issue Feb 25, 2025 · 0 comments
Open

如何在server端打印出correlation_id? #2900

whatausernameis opened this issue Feb 25, 2025 · 0 comments

Comments

@whatausernameis
Copy link

问题描述
我们使用baidu_std协议。现在我们需要在日志中打印出一个能够标识一对req/resp的id。在RpcMeta里有一个correlation_id。在client端应该可以通过controller.call_id()来打印这个correlation_id,但在server端如何打印呢?看起来是被存到了FunctionClosure7的一个private成员里,不通过修改brpc的代码不好打印。
看到了有一个log_id字段,是可以用来满足这个需求的。但看起来实际上correlation_id天然就可以满足这个需求。是否可以有选项,使得把log_id设置成和correlation_id相同的值?

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

1 participant