Skip to content

fix(codecs): prevent spurious timestamp injection in OTLP trace events#25404

Open
kimjune01 wants to merge 1 commit intovectordotdev:masterfrom
kimjune01:fix/otlp-trace-timestamp-25045
Open

fix(codecs): prevent spurious timestamp injection in OTLP trace events#25404
kimjune01 wants to merge 1 commit intovectordotdev:masterfrom
kimjune01:fix/otlp-trace-timestamp-25045

Conversation

@kimjune01
Copy link
Copy Markdown

Summary

When log_namespace is Legacy, the OTLP deserializer forwards the raw namespace to the inner ProtobufDeserializer. For log events this is correct — legacy mode injects a timestamp field. But trace events also flowed through this path, and ProtobufDeserializer injected a spurious timestamp into the trace payload.

This forces LogNamespace::Vector when deserializing traces, since the log namespace concept doesn't apply to trace events. The TODO comment referencing #25045 is replaced by the fix.

How did you test this PR?

Added deserialize_traces_with_legacy_namespace_should_not_inject_timestamp — parses a trace request under LogNamespace::Legacy and asserts no timestamp key is present at the root level.

Change Type

  • Bug fix
  • New feature
  • Dependencies
  • Non-functional (chore, refactoring, docs)

When using `LogNamespace::Legacy`, the ProtobufDeserializer injects
a timestamp into log events. However, this behavior should not apply
to trace events, as the log_namespace concept is logs-specific.

This fix ensures that trace events are always parsed with
`LogNamespace::Vector`, preventing the spurious timestamp injection
while maintaining compatibility with the OTLP trace specification.

Fixes vectordotdev#25045
@kimjune01 kimjune01 requested a review from a team as a code owner May 9, 2026 16:05
@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented May 9, 2026

All contributors have signed the CLA ✍️ ✅
Posted by the CLA Assistant Lite bot.

@kimjune01
Copy link
Copy Markdown
Author

I have read the CLA Document and I hereby sign the CLA

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant