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

Identify call router request in logs #506

Open
Serpentian opened this issue Dec 19, 2024 · 1 comment
Open

Identify call router request in logs #506

Serpentian opened this issue Dec 19, 2024 · 1 comment

Comments

@Serpentian
Copy link
Contributor

Currently it's difficult for users to distinguish call errors, written to log, as they're not identified:

2024-12-18 18:59:25.955 [29638] main/326/main replicaset.lua:614 E> Exception during calling 'vshard.storage.call' on 'filedb_001_2(guest@10.10.78.45:5003)': Timeout exceeded

It was proposed to add trace_id opt to to router call's, so that all logs from that call are logged with that trace_id. Something like that:

2024-12-18 18:59:25.955 [29638] main/326/main replicaset.lua:614 E> Exception during calling 'vshard.storage.call' (trace_id = <...>) on 'filedb_001_2(guest@10.10.78.45:5003)': Timeout exceeded

Even if trace_id is not passed, I propose to automatically set it, we can use monotonically growing number (we should take care of integer overflow). It will majorly boost the readability of the logs.

@Gerold103
Copy link
Collaborator

we should take care of integer overflow

I wouldn't care about an integer overflow. If you use just a regular Lua number, it is a double, which fits up to 2^53 without precision loss. That means 100 days of making a new request every nanosecond. If you use long long (in Lua you can declare it same as in C, like 123LL), then its overflow will take approx 600 years (making request every nanosecond).

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

2 participants