amazon-web-services - 在 Prometheus 监控中,我正在尝试使用 AWS 标签过滤 extraScrapeConfigs
问题描述
在我的普罗米修斯服务器中,我只想从我的 EC2 实例中获取数据,这些实例的标签名为“应用程序”,值为“gitlab-runner-servers”。
以下是我尝试过的方法,但它不起作用 - Prometheus 显示了 us-west-2 区域中的每个 ec2 实例。
extraScrapeConfigs: |
- job_name: ‘gitlab-ec2-runners’
ec2_sd_configs:
- region: us-west-2
port: 9252
filters:
- name: 'tag:application'
values: 'gitlab-runner-servers'
我遵循以下参考 - https://prometheus.io/docs/prometheus/latest/configuration/configuration/#ec2_sd_config
来自 - https://docs.aws.amazon.com/AWSEC2/latest/APIReference/API_DescribeInstances.html
tag:<key>
- The key/value combination of a tag assigned to the resource. Use the tag key in the filter name and the tag value as the filter value. For example, to find all resources that have a tag with the key Owner
and the value TeamA
, specify tag:Owner
for the filter name and TeamA
for the filter value.
关于我需要使用什么来正确过滤的任何建议?
解决方案
推荐阅读
- unity3d - 球在管中与刚体一起移动
- sql - 我们可以同时从 2 个表中选择数据吗
- javascript - 降低水平滚动中 div 的不透明度是否部分可见
- botframework - Bot Framework V4 MS 团队渠道和 GDPR
- linux - 如何在使用 find 命令时仅删除文件名
- android - 无法将 .aab/apk 文件上传到 Play 商店
- google-sheets - Google Sheets - 如何根据另一个单元格中的匹配值连接范围?
- ios - 从应用内的 Firebase In-App-Messaging 打开 url
- javascript - Jquery:仅查找一个最近的匹配元素
- android - 从服务发送的通知中打开我的 kivy 应用程序