Skip to content

Conversation

@tylerbenson
Copy link
Member

@tylerbenson tylerbenson commented Aug 27, 2025

Following on from #2138...

The previous implementation would load the protobuf encoded bytes from disk, deserialize it, then send it through the delegate exporter pipeline which would likely re-serialize it into the exact same format.

This PR reduces the CPU burden by providing an optional alternate path which bypasses the exporter pipeline. Instead it takes the serialized bytes from disk and sends it straight to an HttpExporter or GrpcExporter, which only takes a Marshaler class allowing the serialized bytes to be passed straight through.

Since these exporters like to know the number of serialized elements that are being passed in, I added a function (with the help of Claude) that counts the serialized elements within the protobuf encoded byte array.

A future optimization would be to allow streaming the bytes directly from disk without reading them back into a byte array.

The previous implementation would load the protobuf encoded bytes from disk, deserialize it, then send it through the delegate exporter pipeline which would likely re-serialize it into the exact same format.

This PR reduces the CPU burden by providing an optional alternate path which bypasses the exporter pipeline.
Instead it takes the serialized bytes from disk and sends it straight to an HttpExporter or GrpcExporter, which only takes a `Marshaler` class allowing the serialized bytes to be passed straight through.

Since these exporters like to know the number of serialized elements that are being passed in, I added a function (with the help of Claude) that counts the serialized elements within the protobuf encoded byte array.

A future optimization would be to allow streaming the bytes directly from disk without reading them back into a byte array.
@otelbot-java-contrib
Copy link
Contributor

🔧 The result from spotlessApply was committed to the PR branch.

Copy link
Contributor

@LikeTheSalad LikeTheSalad left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Blocking as it's not compatible with the new API. More details here.

@tylerbenson
Copy link
Member Author

Closing as discussed in #2183 (comment).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants