Skip to content

[pkg/xstreamencoding] add unmarshaler adapters#46754

Merged
atoulme merged 1 commit into
open-telemetry:mainfrom
axw:xstreamencoding-unmarshaler-adapter
Mar 9, 2026
Merged

[pkg/xstreamencoding] add unmarshaler adapters#46754
atoulme merged 1 commit into
open-telemetry:mainfrom
axw:xstreamencoding-unmarshaler-adapter

Conversation

@axw

@axw axw commented Mar 9, 2026

Copy link
Copy Markdown
Contributor

Description

Introduce adapters for plog.LogsUnmarshaler and pmetric.MetricsUnmarshaler which, on first call, read the entire stream into memory and invoke the unmarshaler. Subsequent calls return EOF.

The offset is always the entire stream size in bytes, and if an offset is provided then that many bytes will discarded first.

We also extract LogsDecoderFactory and MetricsDecoderFactory interfaces from LogsDecoderExtension and MetricsDecoderExtension in the encoding package.

This PR was built with the assistance of Cursor.

Link to tracking issue

Relates to #46608

Testing

Tests updated

Documentation

N/A

Introduce adapters for plog.LogsUnmarshaler and
pmetric.MetricsUnmarshaler which, on first call,
read the entire stream into memory and invoke the
unmarshaler. Subsequent calls return EOF.

The offset is always the entire stream size in
bytes, and if an offset is provided then that many
bytes will discarded first.

We also extract LogsDecoderFactory and MetricsDecoderFactory
interfaces from LogsDecoderExtension and MetricsDecoderExtension
in the encoding package.

@atoulme atoulme left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

written by codeowner, merging.

@atoulme atoulme merged commit ea03886 into open-telemetry:main Mar 9, 2026
196 checks passed
ebrdarSplunk pushed a commit to ebrdarSplunk/opentelemetry-collector-contrib that referenced this pull request Mar 9, 2026
#### Description

Introduce adapters for plog.LogsUnmarshaler and
pmetric.MetricsUnmarshaler which, on first call, read the entire stream
into memory and invoke the unmarshaler. Subsequent calls return EOF.

The offset is always the entire stream size in bytes, and if an offset
is provided then that many bytes will discarded first.

We also extract LogsDecoderFactory and MetricsDecoderFactory interfaces
from LogsDecoderExtension and MetricsDecoderExtension in the encoding
package.

This PR was built with the assistance of Cursor.

#### Link to tracking issue

Relates to
open-telemetry#46608

#### Testing

Tests updated

#### Documentation

N/A
esosaoh pushed a commit to esosaoh/opentelemetry-collector-contrib that referenced this pull request Mar 9, 2026
#### Description

Introduce adapters for plog.LogsUnmarshaler and
pmetric.MetricsUnmarshaler which, on first call, read the entire stream
into memory and invoke the unmarshaler. Subsequent calls return EOF.

The offset is always the entire stream size in bytes, and if an offset
is provided then that many bytes will discarded first.

We also extract LogsDecoderFactory and MetricsDecoderFactory interfaces
from LogsDecoderExtension and MetricsDecoderExtension in the encoding
package.

This PR was built with the assistance of Cursor.

#### Link to tracking issue

Relates to
open-telemetry#46608

#### Testing

Tests updated

#### Documentation

N/A
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