Skip to content

fix(inputs.bklite_script): emit business metrics under stdout names - #3

Merged
ZhongmingFan merged 1 commit into
bklitefrom
cursor/bklite-script-stdout-names-e4f3
Sep 29, 2026
Merged

ZhongmingFan merged 1 commit into
bklitefrom
cursor/bklite-script-stdout-names-e4f3

Conversation

@ZhongmingFan

@ZhongmingFan ZhongmingFan commented Sep 29, 2026 •

Copy link
Copy Markdown

Summary

inputs.bklite_script parsed Prometheus stdout with metric version 2, so business samples were Telegraf measurement prometheus (Influx/VictoriaMetrics name prometheus_<stdout>). BKLite script collection needs the short stdout name (e.g. host_cpu_usage_percent) without that prefix, and without relying on name_prefix=bklite_script_{config_id}_.

This switches the parser to metric version 1 and promotes any leftover v2 prometheus points so each sample is written under the stdout metric name. Health stays on measurement bklite_script (bklite_script_up, bklite_script_duration_seconds, …). Correct with or without name_prefix.

Base is WeOps-Lab/telegraf bklite at bklite-v1.32.1.3 (197dc6f20).

Checklist

  • No AI generated code was used in this PR

Related issues

BKLite script-collection metric naming (coordinate with bk-lite dropping business name_prefix).

Verify

go test ./plugins/inputs/bklite_script/ -count=1

Influx line from TestParseStdoutUsesStdoutMeasurementName:

host_cpu_usage_percent value=42

not prometheus, … host_cpu_usage_percent=42 / prometheus_host_cpu_usage_percent. Health remains bklite_script with fields up, duration_seconds, exit_code, parse_errors, truncated.

Note: the fork workflow pr-target-branch.yml fails because it requires PRs onto master. This PR is intentionally based on bklite.

Open in Web Open in Cursor 

Parse Prometheus stdout with metric version 1 so samples are written as
the script metric name (e.g. host_cpu_usage_percent) instead of the v2
prometheus measurement that becomes prometheus_*. Leftover v2 points are
promoted the same way. Health stays on measurement bklite_script and does
not need a name_prefix.

Co-authored-by: ZhongmingFan <ZhongmingFan@users.noreply.github.com>
@ZhongmingFan
ZhongmingFan marked this pull request as ready for review September 29, 2026 06:55
@ZhongmingFan
ZhongmingFan merged commit 1e878e3 into bklite Sep 29, 2026
2 of 4 checks passed
@ZhongmingFan
ZhongmingFan deleted the cursor/bklite-script-stdout-names-e4f3 branch September 29, 2026 06:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant