在中间层DCOS集群上为prometheus设置云监视导出器

时间:2015-08-11 05:10:09

标签: mesos amazon-cloudwatch mesosphere prometheus

我已在 AWS mesosphere DCOS群集上为Prometheus设置了云监视导出程序。我启用了“ CloudWatchFullAccess ”政策。但米,'cloudwatch_exporter_scrape_error'显示非零值。我想知道为什么刮痕会给出错误。

我在哪里可以查看日志或如何调试此问题?

我正在使用的配置文件是

{
   "region": "ap-southeast-1",
   "metrics": [
        {"aws_namespace": "AWS/ELB", "aws_metric_name": "HealthyHostCount",
         "aws_dimensions": ["AvailabilityZone", "LoadBalancerName"],
         "aws_dimension_select": {"LoadBalancerName": ["name of my LB"]},
         "aws_statistics": ["Sum"]
        }
      ]
}

但除了米 - cloudwatch_requests_total之外我没有任何米, cloudwatch_exporter_scrape_duration_secondscloudwatch_exporter_scrape_error接触普罗米修斯。

如何从cloudwatch_exporter获取额外的电表?

2 个答案:

答案 0 :(得分:0)

看起来您正在尝试使用IAM实例配置文件,但无法访问http://169.254.169.254。这是您的网络设置的某种形式的问题,因为这应该在EC2上开箱即用。

您有两种选择。

  1. 您可以修复网络设置,以便再次访问169.254.169.254。
  2. 或者您可以创建具有cloudwatch:ListMetricscloudwatch:GetMetricStatistics IAM权限的IAM用户,并生成访问密钥并将其放入AWS_ACCESS_KEY_IDAWS_SECRET_ACCESS_KEY~/.aws/credentials
  3. 请参阅https://github.com/prometheus/cloudwatch_exporter#credentials-and-permissions

答案 1 :(得分:0)

以下是我的配置文件

{
    "region": "us-west-2",
    "metrics": [
    {"aws_namespace": "AWS/ELB", "aws_metric_name": "HealthyHostCount",
     "aws_dimensions": ["us-west-2a", "test"], "aws_statistics": ["Average"]},
    {"aws_namespace": "AWS/ELB", "aws_metric_name": "UnHealthyHostCount",
     "aws_dimensions": ["us-west-2a", "test"], "aws_statistics": ["Average"]},
    {"aws_namespace": "AWS/ELB", "aws_metric_name": "RequestCount",
     "aws_dimensions": ["us-west-2a", "test"], "aws_statistics": ["Sum"]},
    {"aws_namespace": "AWS/ELB", "aws_metric_name": "Latency",
     "aws_dimensions": ["us-west-2a", "test"], "aws_statistics": ["Average"]},
    {"aws_namespace": "AWS/ELB", "aws_metric_name": "SurgeQueueLength",
     "aws_dimensions": ["us-west-2a", "test"], "aws_statistics": ["Maximum",    "Sum"]},
    ]
}

我可以在下面看到输出

cloudwatch_requests_total 10.0

cloudwatch_exporter_scrape_duration_seconds 2.571412647

cloudwatch_exporter_scrape_error 0.0

但为什么没有其他指标?