feat: metadata propagation through events#582
Open
jvillafanez wants to merge 1 commit intomainfrom
Open
Conversation
9 tasks
85b221d to
6c2d48a
Compare
6c2d48a to
d328b23
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Allow sending metadata through the reva events. The PR also includes some tools for tracing events.
NOTE:
metadata.MDtype will be changed later to a different custom type, as part of the metadata propagation refactor in a different PR. This should happen after we have an initial working version.Expected usage
The event metadata will be automatically populated from the GRPC outgoing context. As said, this is temporary and a proper data structure will be used later.
The event publishers should work without any change. This works both for the metadata propagation and also for the producer-side event tracing.
For event consumers, the
TraceEventConsumer(and the "WithTracer" variant) are provided as a common ground for tracing the events. The returned span needs to be closed manually (usually when the event has been processed), and the returned context should be used during the event processing.Note that we usually want to start a new context whenever we start processing an event.
In addition, the event consumer must populate the GRPC outgoing context with the event metadata to ensure the metadata is propagated.