Skip to content

chore(datadog_logs sink): Output truncated messages as strings - #26635

Open
bruceg wants to merge 1 commit into
masterfrom
bruceg/fix-datadog-logs-utf8-truncation
Open

bruceg wants to merge 1 commit into
masterfrom
bruceg/fix-datadog-logs-utf8-truncation

Conversation

@bruceg

@bruceg bruceg commented Oct 9, 2026

Copy link
Copy Markdown
Member

Summary

When truncating the message field of a log event, the datadog_logs converts it into a string, chops part of it off, adds a truncation marker string, but then stuffs it back into the event as a Bytes value. Since we know it is valid UTF-8 by construction, we can use the String type instead.

This was previously submitted as part of #26608. While it looks like a bug fix, the extra boundary check is not actually reachable in the current caller and so is purely defensive against future (mis)uses.

References

Vector configuration

How did you test this PR?

Does this PR include user facing changes?

  • Yes. Please add a changelog fragment based on our guidelines.
  • No. A maintainer will apply the no-changelog label to this PR.

Contributor Guidelines

  • Please read our Vector contributor resources.
  • Do not hesitate to use @vectordotdev/vector to reach out to us regarding this PR.
  • Before pushing, follow our pre-push guidance.
  • After a review is requested, please avoid force pushes to help us review incrementally.
    • Feel free to push as many commits as you want. They will be squashed into one before merging.
    • For example, you can run git merge origin master and git push.

When truncating the `message` field of a log event, the `datadog_logs` converts
it into a string, chops part of it off, adds a truncation marker string, but
then stuffs it back into the event as a `Bytes` value. Since we know it is valid
UTF-8 by construction, we can use the `String` type instead.

This was previously submitted as part of #26608. While it looks like a bug fix,
the extra boundary check is not actually reachable in the current caller and so
is purely defensive against future (mis)uses.
@bruceg
bruceg requested a review from a team as a code owner October 9, 2026 22:53
@bruceg bruceg added type: tech debt A code change that does not add user value. sink: datadog_logs Anything `datadog_logs` sink related no-changelog Changes in this PR do not need user-facing explanations in the release changelog labels Oct 9, 2026
@github-actions github-actions Bot added the domain: sinks Anything related to the Vector's sinks label Oct 9, 2026
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 9, 2026 •

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-10-09T22:56:06.689124Z f3f7286 PR opened
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@datadoghq-integration datadoghq-integration Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Bits Code Review: PASS

More details

Storing truncated messages as String preserves their content and encoded size. The completed static review found no compatibility issues in caller handling, agent normalization, or repeated serialization.

Was this helpful? React 👍 or 👎

Open Bits AI session

🤖 Bits Code Review · Commit f3f7286

This branch has not been deployed

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

Labels

domain: sinks Anything related to the Vector's sinks no-changelog Changes in this PR do not need user-facing explanations in the release changelog sink: datadog_logs Anything `datadog_logs` sink related type: tech debt A code change that does not add user value.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant