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
feat(kernel): Add message IDs to make it easier to trace messages #34
Conversation
✅ Deploy Preview for merry-scone-cc7a60 ready!
To edit notification comments on pull requests, go to your Netlify site settings. |
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.
looks good, commented on a few minor suggestions
.map_err(|_| RegistrationError::RegistryFull) | ||
.map_err(|_| RegistrationError::RegistryFull)?; | ||
info!(uuid = ?RD::UUID, service_id = self.counter, "Registered"); | ||
self.counter = self.counter.wrapping_add(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.
wonder if we should maybe log something in the event that this wraps, just so that a reader of the logs will know that they may see the same IDs repeat
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.
Kicking this can down the road.
This adds a number of
u32
ID fields to each message in order to make tracing interactions between services easier.u32
might be too much (I suspect u16 is probably enough, at least for service/client IDs), but I think this is a fine place to start. Most of the metadata insertion is "hidden" from end-consumers, happening in the built-in client and service handles, which means it should be hard to get wrong or forget to do.