IP socket options (TTL / hop-limit / DSCP) — depends on prometheus/exporter-toolkit#396#1
Open
randomizedcoder wants to merge 2 commits into
Open
IP socket options (TTL / hop-limit / DSCP) — depends on prometheus/exporter-toolkit#396#1randomizedcoder wants to merge 2 commits into
randomizedcoder wants to merge 2 commits into
Conversation
Primary design spec for a defense-in-depth + QoS feature: clamp the IPv4 TTL / IPv6 Hop Limit and set DSCP on packets leaving the exporter's listening socket. Includes motivation, configuration surface, step-by-step implementation plan with Definition-of-Done per step, platform support matrix, and test coverage matrix. The implementation lives upstream in github.com/prometheus/exporter-toolkit so every toolkit-using exporter benefits. node_exporter picks up the new flags automatically once it bumps go.mod. Signed-off-by: randomizedcoder dave.seddon.ca@gmail.com <dave.seddon.ca@gmail.com>
Picks up the IP socket-options feature (TTL, IPv6 Hop Limit, DSCP) from prometheus/exporter-toolkit -- the toolkit-side change is currently open upstream at prometheus/exporter-toolkit#396. Changes: * README.md: new section "IP socket options" with operator-facing examples and a link to docs/IP_SOCKET_CONFIG.md (the canonical design spec, already on this branch from the design phase). * go.mod: temporary `replace` directive pointing at the fork's exporter-toolkit master so node_exporter can be built and tested against the unmerged toolkit changes. The replace directive is for self-review and pre-release testing only. Before opening the upstream node_exporter PR, the replace will be removed and the require line will be bumped to point at a real tagged exporter-toolkit version (whichever tag includes the upstream PR's merged commits). The three new flags (--web.ipv4-ttl, --web.ipv6-hop-limit, --web.dscp) appear in `node_exporter --help` automatically via kingpinflag.AddFlags in the toolkit; no node_exporter code change needed beyond go.mod and the README link. Signed-off-by: randomizedcoder dave.seddon.ca@gmail.com <dave.seddon.ca@gmail.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Self-review PR — opened against
randomizedcoder/node_exporter:masterso the diff can be reviewed in the GitHub UI before opening upstream. Depends on the toolkit-side PR landing first.What this picks up
The IP socket-options feature being added to
prometheus/exporter-toolkitin prometheus/exporter-toolkit#396. Once that PR merges and the toolkit cuts a new release, node_exporter just needs to bump itsexporter-toolkitdependency and the three new flags appear in--helpautomatically — no node_exporter code change beyond go.mod and the README.New surface visible to a node_exporter operator:
--web.ipv4-ttl/WEB_IPV4_TTL/ip_socket_config.ipv4_ttl(range 1–255)--web.ipv6-hop-limit/WEB_IPV6_HOP_LIMIT/ip_socket_config.ipv6_hop_limit(range 1–255)--web.dscp/WEB_DSCP/ip_socket_config.dscp(range 0–63)Changes in this PR
docs/IP_SOCKET_CONFIG.mdREADME.mddocs/IP_SOCKET_CONFIG.md.go.mod,go.sumreplace github.com/prometheus/exporter-toolkit => github.com/randomizedcoder/exporter-toolkit @masterso this PR is buildable + testable against the unmerged toolkit changes. Will be removed before opening the upstream PR and replaced with arequireof a real released version.Why a
replacedirectiveThe toolkit-side PR (prometheus#396 upstream) isn't merged or tagged yet. To make this PR diff reviewable on GitHub and
go buildrunnable, we need to point exporter-toolkit at a place where the changes actually live — the fork's master, which now has the merged feature commits (via #1 onrandomizedcoder/exporter-toolkit).Before opening the actual upstream
prometheus/node_exporterPR, the workflow is:prometheus/exporter-toolkit#396to merge.cd node_exporter && go mod edit -dropreplace github.com/prometheus/exporter-toolkit && go get github.com/prometheus/exporter-toolkit@<new-tag> && go mod tidy.Test plan
go build ./...clean against the fork-resolved toolkit../node_exporter --helpshows all three new flags with their env-var bindings.Design doc
docs/IP_SOCKET_CONFIG.mdis the canonical spec — security rationale, configuration surface, step-by-step plan with Definition of Done per step, platform support matrix, and a companion-doc link to the toolkit-side brief.🤖 Generated with Claude Code