【发布时间】:2021-02-02 15:59:06
【问题描述】:
我无法使用 Grafana 在 EC2 实例中提取 Amazon Cloudwatch 指标。设置如下:
带有 Grafana 的 EC2 实例:
- 安全组:(ssh,tpc,22,0.0.0.0/0;custom tcp,tpc,3000,0.0.0.0/0;)
- 使用 Grafana 附加到 EC2 实例中的角色的策略:
{
"Version": "2012-10-17",
"Statement": [
{
"Sid": "AllowReadingMetricsFromCloudWatch",
"Effect": "Allow",
"Action": [
"cloudwatch:DescribeAlarmsForMetric",
"cloudwatch:DescribeAlarmHistory",
"cloudwatch:DescribeAlarms",
"cloudwatch:ListMetrics",
"cloudwatch:GetMetricStatistics",
"cloudwatch:GetMetricData"
],
"Resource": "*"
},
{
"Sid": "AllowReadingLogsFromCloudWatch",
"Effect": "Allow",
"Action": [
"logs:DescribeLogGroups",
"logs:GetLogGroupFields",
"logs:StartQuery",
"logs:StopQuery",
"logs:GetQueryResults",
"logs:GetLogEvents"
],
"Resource": "*"
},
{
"Sid": "AllowReadingTagsInstancesRegionsFromEC2",
"Effect": "Allow",
"Action": [
"ec2:DescribeTags",
"ec2:DescribeInstances",
"ec2:DescribeRegions"
],
"Resource": "*"
},
{
"Sid": "AllowReadingResourcesForTags",
"Effect": "Allow",
"Action": "tag:GetResources",
"Resource": "*"
}
]
}
没有检索任何数据的Grafana查询截图:
【问题讨论】:
标签: amazon-web-services amazon-ec2 grafana amazon-cloudwatch