夜莺-Nightingale
夜莺V6
项目介绍 架构介绍
快速开始
黄埔营
安装部署
升级
采集器
使用手册
API
数据库表结构
FAQ
开源生态
Prometheus
版权声明
第1章:天降奇兵
第2章:探索PromQL
第3章:Prometheus告警处理
第4章:Exporter详解
第5章:数据与可视化
第6章:集群与高可用
第7章:Prometheus服务发现
第8章:监控Kubernetes
第9章:Prometheus Operator
参考资料

cloudwatch采集插件

授权

支持role_arn/ak sk/token等多种方式授权

  # access_key = ""
  # secret_key = ""
  # token = ""
  # role_arn = ""
  # web_identity_token_file = ""
  # role_session_name = ""
  # profile = ""
  # shared_credential_file = ""

配置

region 和 endpoint_url

region 和对应的endpoint_url 可以再这里查询 比如

region = "ap-northeast-1"
endpoint_url = "http(s)://monitoring.ap-northeast-1.amazonaws.com"

endpoint_url即使配置http最终请求的也是https

namespaces

namespaces可以在这里查询

namespaces = ["AWS/EC2", "AWS/EBS"]

delay

距离当前时间多久 ,查询指标时间区间的结束值end_time。cloudwatch 默认有延迟,这里建议设置5分钟以上。

delay = "5m"

period

距离end_time的时间,即查询指标时间区间的起始时间。 比如 当前时间是14:00, 参数 period="5m" delay="5m”,表示查询距离[13:45,13:55]10分钟区间内的指标。

period="5m"

ratelimit

ratelimit 是插件单位时间内发送请求的限制, instances级别。 如果是多个namespace,建议可以设置比较大的ratelimit ,或者每个instance 一个namespace

debug_mode

aws sdkdebug模式, 支持

  • LogRequest
  • LogRequestWithBody
  • LogRequestEventMessage
  • LogRetries
  • LogResponse
  • LogResponseWithBody
  • LogResponseEventMessage
  • LogSigning
  • LogDeprecatedUsage
debug_mode = ["LogRequest", "LogResponse"]

注意配置debug_mode以后, categraf --debug模式才会将sdk的debug日志输出

sdk 文档

sdk 代码

interval

参数已废弃

timeout

timeout 请求的超时时间

timeout = "10s"

batch_size

每次请求最大的指标数量 ,建议最大值不超过500

batch_size = 500

statistic_include

namespace级别的filter, 过滤想要的指标

statistic_include = ["average", "sum", "minimum", "maximum", "sample_count"]

statistic_exclude

namespace级别的filter, 过滤不想要的指标

statistic_exclude = ["sum"]

[[instances.metrics]]

配置namespaces下需要拉取哪些指标,只拉取指定的这些指标 ,names为空则拉取所有指标 比如, 可以登录aws机器,通过命令获取EC2的所有指标

aws cloudwatch list-metrics --namespace AWS/EC2

指定namespace/instanceID查看指定实例的结果

aws cloudwatch list-metrics --namespace AWS/EC2 --dimensions Name=InstanceId,Value=i-1234567890abcdef0

查看指标的更多命令可以查询这里

names = ["Latency", "RequestCount"]

statistic_include

保留names指标中的哪些值(xxx指标有xxx_sum xxx_average xxx_maximum xxx_minimum xxx_sample_count 等)

statistic_include = ["average", "sum", "minimum", "maximum", "sample_count"]

statistic_exclude

statistic_include 相反, 去除names指标中的哪些值

[[instances.metrics.dimensions]]

指定指标维度进行查询 , 更多dimensions可以查这里

name = "LoadBalancerName"
value = "p-example"

关于限流

开源版
Flashcat
Flashduty