Skip to content

feat(net): add configurable per-source/sink DSCP (IP_TOS) QoS marking - #25956

Open
glatinone wants to merge 1 commit into
vectordotdev:masterfrom
glatinone:feat/dscp-ip-tos-qos-marking
Open

feat(net): add configurable per-source/sink DSCP (IP_TOS) QoS marking#25956
glatinone wants to merge 1 commit into
vectordotdev:masterfrom
glatinone:feat/dscp-ip-tos-qos-marking

Conversation

@glatinone

Copy link
Copy Markdown

Adds per-source/sink DSCP (IP_TOS) QoS configuration with DSCP name parsing (CS0-CS7, AFxx, EF) and socket application using socket2::SockRef::set_tos(). Unsupported platforms fail gracefully. Includes docs and unit tests for parsing and TOS get/set.

Co-authored-by: Copilot 223556219+Copilot@users.noreply.github.com

Adds DSCP name parsing, socket TOS setters/getters with graceful fallback, config docs, and unit tests.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@glatinone
glatinone requested review from a team as code owners July 28, 2026 05:36
@github-actions github-actions Bot added domain: sources Anything related to the Vector's sources docs review on hold The documentation team reviews PRs only after a PR is approved by the COSE team. labels Jul 28, 2026
@github-actions

Copy link
Copy Markdown
Contributor

Thank you for your contribution! Before we can merge this PR, please sign our Contributor License Agreement.

To sign, copy and post the phrase below as a new comment on this PR.

Note: If the bot says your username was not found, the email used in your git commit may not be linked to your GitHub account. Fix this at github.com/settings/emails, then comment recheck to retry.


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


You can retrigger this bot by commenting recheck in this Pull Request. Posted by the CLA Assistant Lite bot.

@datadog-vectordotdev

Copy link
Copy Markdown

Pipelines

⚠️ Warnings

🚦 1 Pipeline job failed

CLA Assistant | CLAAssistant   View in Datadog   GitHub Actions

Useful? React with 👍 / 👎

This comment will be updated automatically if new data arrives.
🔗 Commit SHA: 60f69d4 | Docs | Datadog PR Page | Give us feedback!

@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: 60f69d4207

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

```toml
[sources.my_tcp]
# ... other settings
ip_tos = "EF" # or "CS5", "AF21", etc.

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge Add real config wiring before documenting ip_tos

The advertised ip_tos key is not actually accepted or applied: this commit only adds standalone files, while src/net.rs does not declare mod qos, src/sources/util/net/tcp/mod.rs does not declare/call qos, and rg "ip_tos|apply_qos|parse_ip_tos" finds no config fields or call sites outside these new files/docs. Cargo will not build the helpers or run their tests, so configurations using this key cannot mark sockets. Please wire the field through the source/sink configs and apply it on connect/accept before documenting it.

Useful? React with 👍 / 👎.

Comment on lines +7 to +8
if let Err(e) = set_stream_tos(stream, t) {
let _ = e;

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge Warn or propagate TOS-setting failures

When set_stream_tos fails for platform, permission, or socket-family reasons, this helper discards the error with let _ = e and returns (). That makes QoS silently absent even though the new reference text says unsupported platforms are ignored with a warning, so operators have no signal that DSCP marking did not take effect. Please emit a warning here or return the error to the caller.

Useful? React with 👍 / 👎.

Comment thread src/net/qos.rs
#[cfg(any(unix, windows))]
{
let sref = SockRef::from(stream);
return sref.set_tos(tos);

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge Handle IPv6 traffic class as well

When this helper is wired to an IPv6 source or sink, SockRef::set_tos only sets the IPv4 IP_TOS option, while IPv6 packets carry DSCP in the IPv6 traffic-class field. Vector accepts IPv6 socket addresses, so IPv6 users would either get an error or a connection whose packets are not marked despite ip_tos being configured. Please set the IPv6 traffic class too, or reject/document IPv4-only support.

Useful? React with 👍 / 👎.

@@ -0,0 +1,15 @@
# DSCP (IP_TOS) QoS Marking

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge Move public reference docs into the website tree

This new user-facing reference page is added under top-level docs/, which this repo uses for developer documentation, while the public Vector reference pages live under website/content/en/docs/reference with CUE-generated component data. Because nothing links or builds docs/reference/qos-dscp.md, the new option page will not appear on vector.dev even after the feature is wired. Please move or duplicate this content in the website reference documentation path.

Useful? React with 👍 / 👎.

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: sources Anything related to the Vector's sources

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant