我已在 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_seconds
,cloudwatch_exporter_scrape_error
接触普罗米修斯。
如何从cloudwatch_exporter获取额外的电表?
答案 0 :(得分:0)
看起来您正在尝试使用IAM实例配置文件,但无法访问http://169.254.169.254。这是您的网络设置的某种形式的问题,因为这应该在EC2上开箱即用。
您有两种选择。
cloudwatch:ListMetrics
和cloudwatch:GetMetricStatistics
IAM权限的IAM用户,并生成访问密钥并将其放入AWS_ACCESS_KEY_ID
和AWS_SECRET_ACCESS_KEY
或~/.aws/credentials
请参阅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
但为什么没有其他指标?