Repository navigation
fix(inputs.bklite_script): emit business metrics under stdout names - #3
Merged
Merged
Conversation
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>
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.
Summary
inputs.bklite_scriptparsed Prometheus stdout with metric version 2, so business samples were Telegraf measurementprometheus(Influx/VictoriaMetrics nameprometheus_<stdout>). BKLite script collection needs the short stdout name (e.g.host_cpu_usage_percent) without that prefix, and without relying onname_prefix=bklite_script_{config_id}_.This switches the parser to metric version 1 and promotes any leftover v2
prometheuspoints so each sample is written under the stdout metric name. Health stays on measurementbklite_script(bklite_script_up,bklite_script_duration_seconds, …). Correct with or withoutname_prefix.Base is WeOps-Lab/telegraf
bkliteatbklite-v1.32.1.3(197dc6f20).Checklist
Related issues
BKLite script-collection metric naming (coordinate with bk-lite dropping business
name_prefix).Verify
go test ./plugins/inputs/bklite_script/ -count=1Influx line from
TestParseStdoutUsesStdoutMeasurementName:not
prometheus, … host_cpu_usage_percent=42/prometheus_host_cpu_usage_percent. Health remainsbklite_scriptwith fieldsup,duration_seconds,exit_code,parse_errors,truncated.Note: the fork workflow
pr-target-branch.ymlfails because it requires PRs ontomaster. This PR is intentionally based onbklite.