Repository navigation
Fix Telegraf options removed in 1.40 on Linux and Windows (fieldpass -> fieldinclude, pid_tag -> tag_with) - #1764
Conversation
|
Azure Pipelines: There may be pipelines that require an authorized user to comment /azp run to run. |
The linux agent ships telegraf 1.39.x and logs deprecation warnings for options that telegraf removes in 1.40.0. Telegraf treats an unrecognized option as a fatal config-load error (not a warning), and an empty value such as `fieldpass = []` fails identically, so on 1.40 every linux ama-logs telegraf process would refuse to start -- including on clusters using the default ConfigMap. Migrate the linux configs to the replacement option names: fieldpass -> fieldinclude fielddrop -> fieldexclude pid_tag -> tag_with (inputs.procstat, also removed in 1.40) Covers the daemonset, replicaset, prometheus sidecar and the separate ama-logs process-metrics telegraf instance, plus the prometheus stanzas generated at runtime by tomlparser-prom-customconfig.rb (linux branch) and tomlparser-osm-config.rb. Windows is intentionally left on the legacy option names: it is pinned to telegraf 1.24.2, which predates fieldinclude/fieldexclude/tag_with (added in 1.29.0). tomlparser-prom-customconfig.rb is shared by both platforms, so it now selects the option names via is_windows?, mirroring the existing timeout/response_timeout branch. The customer-facing ConfigMap keys (prometheus_data_collection_settings fieldpass/fielddrop) and the TELEMETRY_* env var names are unchanged; the new names are only used when rendering telegraf TOML. Also drop ignore_protocol_stats from inputs.net. Protocol stat collection was removed in telegraf 1.37.0 and the option is a no-op, so current behavior already matches the previous `true` setting. The startup validation used `--input-filter file -test`, which only loads the dummy file input and so returned success for configs that are fatally invalid, promoting a broken config that then killed telegraf silently at the real (backgrounded, unchecked) start. Replace it with `telegraf config check`, which validates every configured plugin without gathering, so it stays fast and performs no network scrapes. Verified against the telegraf 1.39.1 binary in a live cluster: daemonset config goes from 6 deprecation warnings to 0, process-metrics from 9 to 0, replicaset/sidecar/generated stanzas remain at 0, all with config check RC=0, and inputs.net emits the identical field set. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
a688b2a to
2cdc5af
Compare
|
/azp run |
|
Azure Pipelines: Successfully started running 1 pipeline(s). 2 pipeline(s) were filtered out due to trigger conditions. |
|
This PR is stale because it has been open 7 days with no activity. Remove stale label or comment or this will be closed in 5 days. |
|
This PR was closed because it has been stalled for 12 days with no activity. |
|
This PR was closed because it has been stalled for 12 days with no activity. |
|
This PR was closed because it has been stalled for 12 days with no activity. |
Resolve the Prometheus parser conflict by retaining ci_prod's TOML escaping and platform-specific field filter names. Update regression coverage and remove the five-line Windows Telegraf pinning note. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
* Upgrade Windows Telegraf to 1.40.0 Consume the official upstream Windows package with a pinned SHA256 and migrate timeout, field-filter, and procstat PID-tag configuration. Preserve ConfigMap keys and Linux behavior; document the deferred discovery cleanup and deadline gaps. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com> * Fix Telegraf service startup in Windows containers Host the unchanged upstream executable with the existing win32-service dispatcher instead of relying on Telegraf's session-zero service detection. Preserve both service roles, bound shutdown and log growth, and contain the child in a kill-on-close job. Cover registration and lifecycle behavior without relaxing TLS, authentication, strict config parsing, or protected-memory defaults. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com> * Close Telegraf service startup containment gap Enroll the service host in its kill-on-close job before creating the Telegraf child, retain the non-inheritable handle until host exit, and cover abrupt and normal startup-boundary exits with local Windows process tests. Wire Windows worker tests into the existing Ruby driver and narrowly suppress the public-checksum and test-loopback DevSkim false positives. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com> Copilot-Session: 08a78bbb-f751-41cb-87b6-96aaf4c1a1ae * Keep existing Telegraf field filters in Windows upgrade Remove the optional fieldinclude/fieldexclude migration and its OS-specific rendering/test helper. Preserve fieldpass/fielddrop and the original timeout variable while retaining the required overall-timeout and procstat PID-tag fixes. Add pinned upstream references for the compatibility rationale. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com> Copilot-Session: 08a78bbb-f751-41cb-87b6-96aaf4c1a1ae --------- Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com> Copilot-Session: 08a78bbb-f751-41cb-87b6-96aaf4c1a1ae
Retain the validated Telegraf 1.40.1 configuration and tests. The resulting tree is identical to the previous PR head; this restores the ci_prod parent lost during the earlier pull/rebase. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
|
This PR was closed because it has been stalled for 12 days with no activity. |
) * fix: quote ConfigMap-derived environment assignments * Upgrade Linux Telegraf to 1.40.1 Remove the outdated Windows Telegraf update comment. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> * Revert misplaced Telegraf update The Telegraf 1.40.1 bump and Windows note removal belong to PR #1764, not this ConfigMap shell-quoting PR. Reverts commit 44237c6. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> --------- Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
) * fix: quote ConfigMap-derived environment assignments * Upgrade Linux Telegraf to 1.40.1 Remove the outdated Windows Telegraf update comment. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> * Revert misplaced Telegraf update The Telegraf 1.40.1 bump and Windows note removal belong to PR #1764, not this ConfigMap shell-quoting PR. Reverts commit 44237c6. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> --------- Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
|
Azure Pipelines: There may be pipelines that require an authorized user to comment /azp run to run. |
|
/azp run |
|
Azure Pipelines: Successfully started running 1 pipeline(s). 2 pipeline(s) were filtered out due to trigger conditions. |
|
Windows is pinned to Telegraf 1.24.2 (kubernetes/windows/setup.ps1), which predates fieldinclude/fieldexclude/tag_with — all added in 1.29.0. Renaming there would break it immediately. The Windows configs keep the legacy names. The five-line Windows pinning note has been removed from setup.ps1; its existing upgrade reminder and Windows version remain unchanged. ^ is outdated. |
|
PR description says telegraf on windows is 1.24.2. |
Updated the PR descriptioon |
|
/azp run |
|
Azure Pipelines: Successfully started running 1 pipeline(s). 2 pipeline(s) were filtered out due to trigger conditions. |
Problem
ci_prodnow ships Telegraf 1.40.1 on both platforms — Linux viakubernetes/linux/setup.sh(#1789) and Windows viakubernetes/windows/setup.ps1(#1785) — while the shipped configs still use option names that 1.40 removed:These read as cosmetic, but they are not. Telegraf treats an unrecognized option as a fatal config-load error, not a warning:
So the binary upgrade and the option rename have to ship together. This PR carries no version pins — both upgrades already landed in
ci_prod; this is the config-side half that makes them safe.In the packaged 1.40.1 binary,
config checkstill accepts legacyfieldpasswhile emittingDeprecationErrormessages, so its exit code alone does not prove those deprecated names are absent. This PR migrates the names on both platforms and tests the rendering explicitly.Fix
Migrate every shipped config to the replacement option names:
fieldpassfieldincludefielddropfieldexcludepid_tag = truetag_with = ["pid"]Covers the Linux daemonset, replicaset, Prometheus sidecar, and the separate
ama-logsprocess-metrics instance; the Windows daemonset and process-metrics configs; and the Prometheus/OSM stanzas generated at runtime bytomlparser-prom-customconfig.rbandtomlparser-osm-config.rb.pid_tag(inputs.procstat) is not in the warning list above because that config runs as a separate, unguarded Telegraf process whose output isn't in the pod log tail — it is removed in 1.40 all the same, and was caught during validation.Also drops
ignore_protocol_statsfrominputs.net. Protocol-stat collection was removed in 1.37.0 and the option has been a no-op since, so behavior already matches the previoustrue. (That one is scheduled for removal in 1.45, not 1.40.)Windows is migrated too
Two consequences:
build/windows/installer/conf/telegraf.confandtelegraf-ama-logs-process-metrics.confare now part of this change.tomlparser-prom-customconfig.rbis shared by both platforms. It previously selected option names viais_windows?; that branch is gone — both platforms renderfieldinclude/fieldexcludeunconditionally, and thetimeout_config_keyindirection is inlined back totimeout. The remainingis_windows?uses in that file are unrelated (config file paths and theTELEMETRY_CUSTOM_PROM_MONITOR_PODSenv var) and are untouched.kubernetes/windows/setup.ps1is not modified by this PR; the Windows version pin and its upgrade reminder come fromci_prod.Startup validation gate
The gate in
kubernetes/linux/main.shwas:--input-filter filerestricts loading to the dummyfileinput, so it returns RC=0 for a config that is fatally invalid — the broken config gets promoted, and the real (backgrounded, unchecked) Telegraf start then dies silently. I verified this against the 1.39.1 binary: the old gate passed a config the agent could not actually load.Replaced with
telegraf config check, which validates every configured plugin and performs no gathering. Note that simply dropping--input-filter filefrom-testwould have been a regression —-testreally does scrape kubelet/cadvisor, so it could fail on unready endpoints and silently discard customer Prometheus config.Validation
Live A/B against the current production image
The branch image was backdoor-deployed to an AKS cluster alongside the production image (
ciprod:3.8.0-ci-prod-09-03-2026-fd42f68c) and compared across 10 Telegraf configuration scenarios — default collection, pod scraping, namespace filtering, custom URLs, field filtering, label selectors, process metrics, and OSM with zero/one/multiple namespaces.InsightsMetricsandPerfmatched per-minute for every scenario;ContainerLogV2showed no trend change.Static and unit
config checkfor all four shipped Linux templates and for generated daemonset, replicaset, and Prometheus-sidecar configurations. Remaining startup placeholders used test defaults and service-account fixtures in an isolated container with networking disabled.Earlier validation (Telegraf 1.39.1, live cluster)
config checktelegraf.conf(daemonset)telegraf-ama-logs-process-metrics.conftelegraf-rs.conf(replicaset)telegraf-prom-side-car.confAlso confirmed:
inputs.netemits an identical field set before/after the rename — no metric drift.telegraf config migrateindependently produces the same mapping for all five affected plugin types (disk,diskio,net,prometheus,procstat). Its output wasn't taken wholesale because it reorders and reformats the entire file; the renames here are surgical.[inputs.disk.tagdrop],[inputs.procstat.tags]) — otherwise they'd bind to the nested table, which is what the existinginfluxdata/telegraf#5615"ORDER matters" comment guards against.Not changed
fieldpass/fielddropunderprometheus_data_collection_settingsincontainer-azm-ms-agentconfig.yamlare a public API and stay as-is. The parser reads those keys and maps them to the current Telegraf names when rendering TOML.TELEMETRY_*_FIELDPASS_LENGTHenv var names.ci_prod).kubernetes/windows/setup.ps1.