支持开启http服务后pushtateway接口后通过配置文件中agent_host_tag从推送的数据中指定agent_hostname的值 #984
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.
categraf 支持开启http服务后pushtateway接口后通过配置文件中agent_host_tag从推送的现有指标中指定一个key提取它的值置换到agent_hostname中,同时也直接动态生效模式,在推送给的指标中增加agent_host_tag的label指定的值就是用于置换的key。ignore_hostname在配置文件中为false才会生效。
动态配置方法
ignore_hostname //用于决定是否忽略主机名
ignore_global_labels //是否忽略标签
agent_host_tag //使用指定的key对应的值置换agent_hostname的值,为空的情况下默认使用categraf hostname配置