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

Include shard_id in the log #365

Open
akiradeveloper opened this issue May 23, 2024 · 1 comment
Open

Include shard_id in the log #365

akiradeveloper opened this issue May 23, 2024 · 1 comment
Labels
enhancement New feature or request

Comments

@akiradeveloper
Copy link
Owner

No description provided.

@akiradeveloper akiradeveloper added the enhancement New feature or request label May 23, 2024
@akiradeveloper akiradeveloper changed the title Include lane_id in the log Include shard_id in the log Oct 30, 2024
@akiradeveloper
Copy link
Owner Author

akiradeveloper commented Oct 30, 2024

To include shard_id in the log, we could use task_local (https://docs.rs/tokio/latest/tokio/task/struct.LocalKey.html).

We can give a context to task so inside task can have a reference to it. In this case, we can give shard_id as a context and all log macros (like info!) can refer to it. For convenience, we may need to implement special log macros that uses the context.

This way, obviously we can cover the internal threads but how to cover the gRRC request context is still unsure (at least for me).

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

No branches or pull requests

1 participant