Skip to content

feat(datadog_logs): optionally truncate oversized log events - #26512

Merged
bruceg merged 15 commits into
masterfrom
bruceg/datadog-logs-truncation
Oct 2, 2026
Merged

bruceg merged 15 commits into
masterfrom
bruceg/datadog-logs-truncation

Conversation

@bruceg

@bruceg bruceg commented Sep 29, 2026

Copy link
Copy Markdown
Member

Summary

Adds opt-in encoded-log and retained-message limits to the Datadog logs sink. When enabled, this preserves standard fields, mark shortened messages, and shrinks encoded messages to fit configured payload limits.

References

Vector configuration

How did you test this PR?

The unit tests exercise the new functionality, including an added captive HTTP server test.

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.

Adds opt-in encoded-log and retained-message limits to the Datadog logs sink.
When enabled, this preserves standard fields, mark shortened messages, and
shrinks encoded messages to fit configured payload limits.
@bruceg
bruceg requested a review from ArunPiduguDD September 29, 2026 21:24
@bruceg
bruceg requested review from a team as code owners September 29, 2026 21:24
@bruceg bruceg added type: enhancement A value-adding code change that enhances its existing functionality. provider: datadog Anything `datadog` service provider related sink: datadog_logs Anything `datadog_logs` sink related labels Sep 29, 2026
@github-actions github-actions Bot added docs review on hold The documentation team reviews PRs only after a PR is approved by the COSE team. domain: sinks Anything related to the Vector's sinks domain: external docs Anything related to Vector's external, public documentation and removed docs review on hold The documentation team reviews PRs only after a PR is approved by the COSE team. labels Sep 29, 2026
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Sep 29, 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-02T21:21:26.338279Z 1c2be34 New commits
ℹ️ 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

The opt-in truncation path preserves standard fields, accounts for encoded size and UTF-8 boundaries, and drops irreducible events without blocking later logs; no reportable defect was identified.

Was this helpful? React 👍 or 👎

Open Bits AI session

🤖 Bits Code Review · Commit e94cbee · @DataDog review to ask questions

@tessneau tessneau 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.

a couple comments, but deferring to @ArunPiduguDD for final OP review since he has the context

Comment thread src/sinks/datadog/logs/sink.rs Outdated
Comment thread src/sinks/datadog/logs/sink.rs
Comment thread src/sinks/datadog/logs/sink.rs
@github-actions github-actions Bot added the docs review on hold The documentation team reviews PRs only after a PR is approved by the COSE team. label Sep 30, 2026
Comment thread src/sinks/datadog/logs/sink.rs Outdated
@bruceg

bruceg commented Sep 30, 2026

Copy link
Copy Markdown
Member Author

I have reworked the implementation to just focus on truncating the message field when the event is oversized. If further size reduction is desired, we can work that out in a second PR.

@bruceg
bruceg requested a review from tessneau September 30, 2026 23:59

@chatgpt-codex-connector chatgpt-codex-connector 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.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 22a148fe3c

ℹ️ 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".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread src/sinks/datadog/logs/sink.rs Outdated

@tessneau tessneau 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.

couple comments

Comment thread src/sinks/datadog/logs/sink.rs
Comment thread src/sinks/datadog/logs/sink.rs Outdated
Comment thread src/sinks/datadog/logs/sink.rs
Comment thread src/sinks/datadog/logs/sink.rs Outdated
@bruceg
bruceg requested a review from tessneau October 1, 2026 22:25
Comment thread src/sinks/datadog/logs/sink.rs Outdated
@bruceg
bruceg requested a review from tessneau October 2, 2026 14:30

@chatgpt-codex-connector chatgpt-codex-connector 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.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 8305c63d79

ℹ️ 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".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread website/cue/reference/components/sinks/datadog_logs.cue

@tessneau tessneau 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.

one more suggestion but this already feels in a good state, thanks for keeping on this 🎉

Comment thread src/sinks/datadog/logs/sink.rs Outdated

@thomasqueirozb thomasqueirozb left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Nice! Approving to unblock. None of the comments are blocking

Comment thread src/sinks/datadog/logs/sink.rs Outdated
Comment thread src/sinks/datadog/logs/sink.rs Outdated
Comment thread src/sinks/datadog/logs/sink.rs
Comment thread src/sinks/datadog/logs/sink.rs
Comment thread src/sinks/datadog/logs/sink.rs Outdated
@github-actions github-actions Bot removed the docs review on hold The documentation team reviews PRs only after a PR is approved by the COSE team. label Oct 2, 2026
@thomasqueirozb thomasqueirozb added the docs review on hold The documentation team reviews PRs only after a PR is approved by the COSE team. label Oct 2, 2026
@github-actions github-actions Bot removed the docs review on hold The documentation team reviews PRs only after a PR is approved by the COSE team. label Oct 2, 2026
@bruceg
bruceg enabled auto-merge October 2, 2026 21:15

@chatgpt-codex-connector chatgpt-codex-connector 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.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 1c2be34329

ℹ️ 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".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread src/sinks/datadog/logs/sink.rs Outdated
@bruceg
bruceg added this pull request to the merge queue Oct 2, 2026
Merged via the queue into master with commit de5c779 Oct 2, 2026
62 checks passed
@bruceg
bruceg deleted the bruceg/datadog-logs-truncation branch October 2, 2026 22:29
@github-actions github-actions Bot locked and limited conversation to collaborators Oct 2, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

domain: external docs Anything related to Vector's external, public documentation domain: sinks Anything related to the Vector's sinks provider: datadog Anything `datadog` service provider related sink: datadog_logs Anything `datadog_logs` sink related type: enhancement A value-adding code change that enhances its existing functionality.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants