原因:
修正:
fields @timestamp, @message
症状:
解決:
BucketSizeBytesの場合:
Query 1:
Query 2:
Visualization:
NumberOfObjectsの場合: (同じ箇所は省略)
Queries:
Visualization:
DataSourceの種類によって、使える関数が異なる。
CloudWatchだと、一つのQueryでは計算ができないので、計算用の別のQueryを使う。
Totalを別metricsとして表示等も出来る。
例1: metrics A(Byte)の月額金額(1GBあたり、$0.1)を出したい。
example_byte / 1024 / 1024 / 1024 * 0.1
{{label}}
$region = regions()
$EC2_TagsName: ec2_instance_attribute($region, Tags.Name, {}) Custom all value: * Multi-value: uncheck
$EC2_InstanceId: ec2_instance_attribute($region, InstanceId, {"tag:Name": ["$EC2_TagsName"]})
$LinkedAccount: dimension_values($region, AWS/Billing, EstimatedCharges, LinkedAccount)
$ServiceName: dimension_values($region, AWS/Billing, EstimatedCharges, ServiceName)
$RDS_DBInstanceIdentifier: dimension_values($region,AWS/RDS,CPUUtilization,DBInstanceIdentifier)
$DynamoDB_TableName: dimension_values($region,AWS/DynamoDB,ConsumedReadCapacityUnits,TableName)
$ELB_LoadBalancerName: dimension_values($region,AWS/ELB,RequestCount,LoadBalancerName)
$ALB_LoadBalancer: dimension_values($region,AWS/ApplicationELB,RequestCount,LoadBalancer)
$SQS_QueueName: dimension_values($region,AWS/SQS,ApproximateNumberOfMessagesVisible,QueueName)
$ElastiCache_CacheClusterId: dimension_values($region,AWS/ElastiCache,CPUUtilization,CacheClusterId)
$Logs_LogGroupName: dimension_values($region,AWS/Logs,IncomingLogEvents,LogGroupName)
$S3_BucketName: dimension_values($region,AWS/S3,BucketSizeBytes,BucketName)
$CloudFront_DistributionId: dimension_values(us-east-1,AWS/CloudFront,Requests,DistributionId)
$ClientVpn_Endpoint: dimension_values($region,AWS/ClientVPN,ActiveConnectionsCount,Endpoint)
$VPN_VpnId: dimension_values($region,AWS/VPN,TunnelState, VpnId)
sudo mkdir /usr/share/grafana/.aws sudo vim /usr/share/grafana/.aws/credentials --- [default] aws_access_key_id = **** aws_secret_access_key = **** region = ap-northeast-1 --- sudo chown -R grafana:grafana /usr/share/grafana/.aws/ sudo chmod -R 600 /usr/share/grafana/.aws/credentials