-
Notifications
You must be signed in to change notification settings - Fork 4k
core,services: v1 binlog #4846
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
core,services: v1 binlog #4846
Conversation
- Log using new proto definition - Remove io.grpc.BinaryLog.CallId because a call ID is now an AtomicLong - Add the concept of "always included" and "never included" metadata keys. This is needed because grpc-status-details-bin is already logged in the binlog msg, and we will log grpc-trace-bin for the census info. - unit tests are effectively rewritten
| */ | ||
| class BinaryLogProviderImpl extends BinaryLogProvider { | ||
| // avoid using 0 because proto3 long fields default to 0 when unset | ||
| private static final AtomicLong counter = new AtomicLong(1); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why did this become static?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In an effort to simplify the call id for the grfc, I made it so that the call id is a unique uint64. I didn't want the same ID to appear in different files if multiple log files are used. https://github.com/grpc/proposal/blame/master/A16-binary-logging.md#L107
|
|
||
| TimeProvider SYSTEM_TIME_PROVIDER = new TimeProvider() { | ||
| final long offsetNanos = | ||
| TimeUnit.MILLISECONDS.toNanos(System.currentTimeMillis()) - System.nanoTime(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If the clock changes, then the timestamps will be incorrect. Is that what is supposed to happen?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Let's simply report the current system time. There's no requirement to have a high resolution timestamp.
keys. This is needed because grpc-status-details-bin is already
logged in the binlog msg, and we will log grpc-trace-bin for the
census info.