DLPX-98733 Wire up config directory for drop-ins to delphix-telegraf.service - #127
Open
willguyette wants to merge 1 commit into
Open
DLPX-98733 Wire up config directory for drop-ins to delphix-telegraf.service#127willguyette wants to merge 1 commit into
willguyette wants to merge 1 commit into
Conversation
willguyette
force-pushed
the
dlpx/pr/willguyette/9489f912-b5f9-41c4-9c7f-a2c4b19ce32f
branch
from
August 28, 2026 18:20
1e9fd93 to
e66e3bc
Compare
willguyette
requested review from
dbshah12 and
sebroy
and
a lite review from Copilot
August 28, 2026 18:30
There was a problem hiding this comment.
Pull request overview
Wires Telegraf “drop-in” configuration support into the Delphix Engine Telegraf startup path, enabling external consumers to add inputs/outputs without editing product-owned Telegraf config files.
Changes:
- Add guidance in
telegraf.basedirecting external consumers to use/etc/telegraf/telegraf.ddrop-ins. - Update
delphix-telegraf-serviceto invoke Telegraf with-config-directory /etc/telegraf/telegraf.dand enforce restrictive permissions on that directory at startup.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
| telegraf/telegraf.base | Adds a pointer comment directing external configuration to /etc/telegraf/telegraf.d. |
| telegraf/delphix-telegraf-service | Adds -config-directory support and startup-time permission lockdown for the drop-in directory. |
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
willguyette
force-pushed
the
dlpx/pr/willguyette/9489f912-b5f9-41c4-9c7f-a2c4b19ce32f
branch
from
August 28, 2026 19:10
e66e3bc to
10d4eb1
Compare
willguyette
force-pushed
the
dlpx/pr/willguyette/9489f912-b5f9-41c4-9c7f-a2c4b19ce32f
branch
from
August 28, 2026 19:16
10d4eb1 to
7a416a3
Compare
willguyette
marked this pull request as ready for review
August 28, 2026 19:20
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.
Problem Statement
There's no supported way for a consumer outside this package to add Telegraf inputs/outputs on a Delphix Engine without editing product-owned files directly. This surfaced when the
dlpx-qa-gateperformance regression automation (whichsed-patches/etc/telegraf/telegraf.baseto add an external[[outputs.influxdb]]block forwarding metrics toinflux1-prod-usw2.ops.delphix.com) silently broke after the InfluxDB/Telegraf feature restructuredtelegraf.base. The comment line the performance team'ssedanchored on no longer exists, so the insert became a no-op with no error. Full root-cause writeup in DP-2736; this ticket (DLPX-98733) is the proposed engine-side fix.Solution
Rather than
sedpatch the product config files, wire-config-directory /etc/telegraf/telegraf.dinto the Telegraf invocation indelphix-telegraf-service. That directory already exists — currently empty and unreferenced. Consumers can now drop-in a self-contained*.conffile (e.g. an additional[[outputs.influxdb]]block) with zero edits totelegraf.baseor any other product-owned file, and it survivestelegraf.confregeneration indefinitely sincedelphix-telegraf-service's rebuild logic never touches that directory.Since Telegraf runs as root (
delphix-telegraf.servicehasUser=root) and Telegraf configs support plugins (inputs.exec,outputs.exec, etc.) that execute arbitrary commands,delphix-telegraf-servicenow explicitly locks/etc/telegraf/telegraf.dtoroot:root 700on every start rather than relying on umask or upstream package defaults. Added a pointer comment intelegraf.base's output section directing future readers to the new directory instead of editing the file.GitHub Copilot's automated review flagged that the initial version of this lockdown didn't check whether
mkdir/chown/chmodactually succeeded — if they failed, the script fell through and started Telegraf with-config-directorypointed at a directory whose permissions weren't verified. Implemented a fix for this to instead disable the-config-directoryflag and log an error if lockdown fails, so base metric collection keeps running even in that edge case — only the drop-in extension point is unavailable until the underlying cause is fixed and the service restarts.Testing Done
Confirmed the installed Telegraf binary (1.39.3) supports
--config-directorybefore writing the change.Deployed and validated on two engines:
Fresh engine (
wg-telegraf.dlpxdc.co, cloned offdevelop, no prior manual patches) — clean-room validation of the fix in isolation:telegraf -config /etc/telegraf/telegraf.conf(no-config-directory),telegraf.dwasroot:root 755and empty, only the 2 localoutputs.influxdb_v2blocks existed.delphix-telegraf-serviceandtelegraf.base, restarteddelphix-telegraf.-config-directory /etc/telegraf/telegraf.d.telegraf.dpermissions are nowroot:root 700— verified by attemptinglsas the non-rootdelphixuser and gettingPermission denied.cpumeasurement still flowing into the localdefaultbucket every 10s as before.qa-external-influx.conf(chmod 640, root-owned) intotelegraf.ddefining an additional[[outputs.influxdb]]pointing atinflux1-prod-usw2.ops.delphix.com(InfluxDB 1.7.7) — no edits totelegraf.baseordelphix-telegraf-serviceneeded.journalctl -u delphix-telegrafshowed zero errors (excluding pre-existing, unrelatedestat/BCC kernel-compatibility noise on process exit, confirmed unrelated to this change).influx1-prod-usw2directly via its HTTP API and confirmed this engine'scpudata (host=ip-10-110-246-90) landed in thetelegraf_metricsdatabase, concurrently with the continued local writes — proving both outputs run side by side with no conflict.Existing engine (
scale-dlpx-qa-release-DOSEREL-1.dlpxdc.co), which had DP-2736's manual stopgap patch (external output hand-appended directly totelegraf.base) — validated the migration path:.confapproach intelegraf.d.delphix-telegraf-service, all re-tested onwg-telegraf.dlpxdc.co:mkdir -p $TELEGRAF_CONFIG_DIRto fail (by placing a regular file where a path component should be a directory) against an isolated copy of the script pointed at throwaway paths, confirming the original code silently continued to start Telegraf regardless.1and logs an error vialoggerwithout ever invoking Telegraf, in isolation./etc/telegraf/telegraf.d(swapped for a file) and restarting the realdelphix-telegrafservice. Confirmed viajournalctl/systemctl statusthat systemd's defaultStartLimitBurst=5/StartLimitIntervalUSec=10sbounds this to 5 rapid restart attempts (under 1 second total, not an infinite crash loop), after which the unit is left infailed (Result: exit-code)withStartLimitAction=none— meaning the entire Telegraf service (not just the drop-in feature) stays down until a manualsystemctl reset-failed && systemctl restart delphix-telegrafonce the underlying cause is fixed. Restored the real directory and service to healthy afterward.-config-directoryon lockdown failure, keep base collection running) and re-verified in isolation: forced the samemkdirfailure, confirmed the error is still logged vialogger, and confirmed — by inspecting the process table mid-run — that Telegraf actually started successfully and loaded all inputs/outputs, with the invoked command line correctly omitting-config-directoryentirely. The real production Telegraf process was undisturbed throughout this isolated test.delphix-telegrafactive, correct-config-directorycommand line,telegraf.dstillroot:root 700, existing drop-in intact, zero errors.