@@ -7,7 +7,8 @@ BlueKing Lite script-monitoring input.
77` inputs.exec ` is unchanged.
88
99BKLite child configs should only set the user-facing fields below. Sandbox
10- limits, timeout, and root policy are ** fixed in the plugin** (not toggles).
10+ limits and root policy are ** fixed in the plugin** (not toggles). Optional
11+ ` timeout ` is capped at interval-1s.
1112
1213## Global configuration options <!-- @/docs/includes/plugin_config.md -->
1314
@@ -26,15 +27,20 @@ See the [CONFIGURATION.md][CONFIGURATION.md] for more details.
2627# Telegraf pipeline; failures are reported via bklite_script health metrics.
2728#
2829# Platform-enforced (not configurable in this plugin):
29- # - timeout = interval - 1s (set interval >= 60s)
30+ # - timeout is capped at interval- 1s (default = cap; set interval >= 60s)
3031# - Linux: refuse to run as root; drop to run_as when Telegraf is root
3132# - Linux: CPU / memory / process limits (cgroup v2 and/or setrlimit)
3233# - per-instance file lock (no overlapping runs)
3334# - script body is never placed in process argv
3435[[inputs .bklite_script ]]
35- # # Collection interval. Must be at least 60s. Child timeout is interval-1s.
36+ # # Collection interval. Must be at least 60s.
3637 interval = " 60s"
3738
39+ # # Optional script timeout. Unset or "0s" keeps interval-1s (same as
40+ # # previous behavior). Effective timeout is min(timeout, interval-1s);
41+ # # values above the cap are clamped and logged once at startup.
42+ # timeout = "30s"
43+
3844 # # Optional name used as the "script" tag on health and parsed metrics.
3945 # script_name = ""
4046
@@ -75,21 +81,24 @@ See the [CONFIGURATION.md][CONFIGURATION.md] for more details.
7581| Field | Notes |
7682| -------| --------|
7783| ` interval ` | Required, ** ≥ 60s** . Telegraf collection interval for this input. |
84+ | ` timeout ` | Optional. Unset or ` 0 ` uses ` interval - 1s ` . Effective value is ` min(timeout, interval - 1s) ` . |
7885| ` script ` / ` script_env ` | Script body. Written to a private file; ** not** in argv. |
7986| ` interpreter ` / ` params ` | How the file is executed. |
8087| ` environment ` | Secrets (` KEY=value ` ) for the child. |
8188| ` run_as ` | Linux non-root user. Windows: not supported (service account). |
8289
8390### Platform-enforced behavior (fixed)
8491
85- - ** Timeout** = ` interval - 1s ` . There is no user ` timeout ` knob.
92+ - ** Timeout cap** = ` interval - 1s ` . Configured ` timeout ` cannot exceed this.
93+ Unset or ` 0 ` keeps that default (same as previous behavior). Exceeding the
94+ cap is clamped and logged once at Init.
8695- ** Linux root** : Init fails if the child would run as root: empty ` run_as `
8796 while Telegraf is root, ` run_as = "root" ` , or any account whose uid is 0.
8897 There is no ` allow_root ` flag. When Telegraf is root, set ` run_as ` to a
8998 non-root account; the child is launched with ` setuid ` /` setgid ` .
9099- ** Linux resource limits** (always applied, no disable flag):
91100 - memory: 256MiB (` cgroup v2 memory.max ` when writable, plus ` RLIMIT_AS ` )
92- - CPU time: ` RLIMIT_CPU ` equal to the derived timeout (seconds)
101+ - CPU time: ` RLIMIT_CPU ` equal to the effective timeout (seconds)
93102 - processes: 64 via ` cgroup v2 pids.max ` when writable; if cgroup setup
94103 fails, ` RLIMIT_NPROC=256 ` (per-UID ceiling) is applied so a fork bomb
95104 cannot unbounded-spawn. Windows has no CPU/memory/nproc quotas.
0 commit comments