gpt4 book ai didi

azure - VictoriaMetrics - 在 azure_sd_config 中传递过滤器,如 ec2_sd_config

转载 作者:行者123 更新时间:2023-12-03 02:09:38 26 4
gpt4 key购买 nike

我必须使其适用于azure平台,vmagent的scrape_config解决方案在AWS上运行良好,但无法在Azure中找到类似的解决方案。在这个特定的代码片段中,我们从具有标签键:mon_exporters 和值:node 的虚拟机中配置了 node_exporter 的抓取配置。查看了官方文档https://docs.victoriametrics.com/sd_configs.html#azure_sd_configs但找不到任何提及过滤器选项的内容

有什么方法可以根据我的需求过滤掉虚拟机,因为现在它会获取该特定订阅中的所有虚拟机

- job_name: 'node_exporter'
honor_timestamps: true
scrape_interval: 1m
scrape_timeout: 15s
metrics_path: /metrics
scheme: http
follow_redirects: true
azure_sd_configs:
- subscription_id: 'xxxxx'
authentication_method: 'ManagedIdentity'
environment: 'AzurePublicCloud'
refresh_interval: 5m
port: 9100
filters:
- name: 'tag:mon_exporters'
values: ["*node*"]

最佳答案

azure_sd_config VictoriaMetrics 不支持 filters 选项。但是您可以使用 action: keep relabeling 保留所需的目标在 __meta_azure_machine_tag_mon_exporters 标签上。尝试以下配置:

- job_name: 'node_exporter'
scrape_interval: 1m
azure_sd_configs:
- subscription_id: 'xxxxx'
authentication_method: 'ManagedIdentity'
port: 9100
relabel_configs:
- action: keep
if: '{__meta_azure_machine_tag_mon_exporters="node"}'

查看有关此类重新标记的更多详细信息 here

关于azure - VictoriaMetrics - 在 azure_sd_config 中传递过滤器,如 ec2_sd_config,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/73725291/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com