Skip to content

feat(sink): add configurable payload limit to datadog_logs sink - #26396

Open
dd-sebastien-lb wants to merge 2 commits into
masterfrom
sebastien.lubineau/configurable-dd-payload-limit
Open

dd-sebastien-lb wants to merge 2 commits into
masterfrom
sebastien.lubineau/configurable-dd-payload-limit

Conversation

@dd-sebastien-lb

@dd-sebastien-lb dd-sebastien-lb commented Sep 16, 2026

Copy link
Copy Markdown
Contributor

Summary

Allow max_payload_bytes to be configurable for datadog_logs sink.

References

Vector configuration

sources:
  http_in:
    type: http_server
    address: 0.0.0.0:8081
    encoding: json

sinks:
  dd_logs:
    type: datadog_logs
    inputs: [http_in]
    endpoint: http://127.0.0.1:8080
    default_api_key: test_key
    compression: none
    max_payload_bytes: 10000000  # 10 MB — above the default 5 MB Datadog limit
    batch:
      max_bytes: 9000000         # batch goal: 9 MB (headroom = 1 MB > BATCH_HEADROOM_BYTES)
      timeout_secs: 5

How did you test this PR?

  • Units tests
  • Above configuration successfully sending events to compatible sink

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.

@github-actions github-actions Bot added the domain: sinks Anything related to the Vector's sinks label Sep 16, 2026
@dd-sebastien-lb
dd-sebastien-lb force-pushed the sebastien.lubineau/configurable-dd-payload-limit branch from 41b4820 to 9e6f479 Compare September 16, 2026 14:21
@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: 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 16, 2026
@dd-sebastien-lb
dd-sebastien-lb force-pushed the sebastien.lubineau/configurable-dd-payload-limit branch from 9e6f479 to 35e041d Compare September 17, 2026 07:55
@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 17, 2026
@dd-sebastien-lb
dd-sebastien-lb marked this pull request as ready for review September 17, 2026 09:29
@dd-sebastien-lb
dd-sebastien-lb requested review from a team as code owners September 17, 2026 09:29

@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: 35e041d056

ℹ️ About Codex in GitHub

Codex has been enabled to automatically 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 👍.

When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".

Comment thread src/sinks/datadog/logs/config.rs

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

just a suggestion on the docs

Comment on lines +84 to +87
The batch goal is derived automatically as `max_payload_bytes - 750,000` bytes, preserving a
750 KB safety headroom. Events larger than the batch goal are sent alone in their own
request. `batch.max_bytes` can be raised up to this derived cap; attempting to set it above
the cap is rejected at startup.

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.

IMO these details could be skipped or simplified. I think that what is worth highlighting is that the sink will split the batch if it exceeds the max_payload_size, and if a single event exceeds it it will be tossed.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

I find it interesting to provide as theses details as it can help making tradeoff if for some reason you want to lower the max_payload_bytes since the safety headroom is not configurable

Comment thread src/sinks/datadog/logs/config.rs Outdated
Comment on lines +79 to +84
/// Maximum uncompressed payload size in bytes sent to the endpoint. Must be at least
/// 5,000,000 (5 MB, the standard Datadog API limit). Increase this when targeting a
/// compatible endpoint that accepts larger payloads. The batch goal is derived as
/// `max_payload_bytes - 750,000` bytes; events larger than the batch goal are sent
/// alone in their batch.
#[serde(default)]

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.

technically, it does not need to be at least 5MB, but there's not really a point in setting a lower value. I think we can keep it this way

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.

Agreed, I think that the wording here can be changed, Something like:

"it is recommended to be set to at least 5,000,000 (5 MB, the standard Datadog API limit)"

or similar

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

I actually made a validation to enforce a minimum limit of 5Mb since all events below that limit are going to be accepted. I think it can cause confusion if we allow users to configure a lower limit and they start losing events.
Setting a lower value would be similar to have a filtering on large event. I don't know if this is something we want to offer in the destination?

@dd-sebastien-lb
dd-sebastien-lb force-pushed the sebastien.lubineau/configurable-dd-payload-limit branch from 83c3672 to bdf1add Compare September 18, 2026 11:39

@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: bdf1add038

ℹ️ About Codex in GitHub

Codex has been enabled to automatically 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 👍.

When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".

Comment thread config/examples/datadog_logs_large_payload.yaml Outdated
Comment thread config/examples/datadog_logs_large_payload.yaml Outdated
Comment thread src/sinks/datadog/logs/config.rs
@dd-sebastien-lb
dd-sebastien-lb force-pushed the sebastien.lubineau/configurable-dd-payload-limit branch 2 times, most recently from 762e4c0 to 43011c9 Compare September 18, 2026 13:01
@dd-sebastien-lb
dd-sebastien-lb force-pushed the sebastien.lubineau/configurable-dd-payload-limit branch from 43011c9 to 75a9734 Compare September 18, 2026 13:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

docs review on hold The documentation team reviews PRs only after a PR is approved by the COSE team. domain: external docs Anything related to Vector's external, public documentation domain: sinks Anything related to the Vector's sinks

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants