You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Extend ItemContainer to be able to pass arbitrary headers/metadata for each item #4881
n an envelope each item has its own header to attach item specific metadata to it, Relay makes use of it to 'remember' individual decisions on a per item basis. Sometimes just locally, sometimes when passing between different Relay instances.
An item container, does not have the ability as it is a single envelope item for multiple logical items. Relay still needs the ability to pass headers/metadata with each item.
For example, Relay needs to remember the original bytesize of each individual item when it was received by Relay on the item.
Idea:
Embed a magic __headers key into each JSON object that can be used by Relay to embed metadata into each item. Deserialization of the ItemContainer should yield some variant of Vec<(Annotated<T>, S)> where T is the contained item and S is the metadata.
The downside of embedding a magic field is, there are potential clashes with the protocol (unlikely, we control the protocol). Alternatively we can also find a different way of transporting the metadata, like:
Have a separate vector containing just item metadata [{..}, null, null, null, {..}], in this case only the 1st and 5th log item have any metadata. The downside here is, this seems very error prone and slightly harder to debug/reason about.
Change the container format from {items: [T]} to {items: [{headers: {}, value: T}]}, this either requires an SDK change, container version change or some compatibility layer which automatically recognizes the format.
Since for now this metadata is only required for 'internal' Relays, which are in lockstep with the Sentry version, a decision now can still be re-evaluated later.
Activity
feat(logs): Track accepted bytes per individual log item (#4886)
ref(server): Make the ourlog header a part of the item container (#4906)