Skip to content

Commit

Permalink
Add more metrics to the services (#161)
Browse files Browse the repository at this point in the history
* Add AWS/ApplicationELB metrics

* Remove duplicates

* Add AWS/DocDB metrics

* Add AWS/ECR metrics

* Add ECS/ContainerInsights metrics

* Add AWS/Firehose metrics

* Add AWS/Kinesis metrics

* Add AWS/MWAA metrics

* Add AWS/NetworkELB metrics

* Add AWS/Scheduler metrics

* Add AWS/SNS metrics

* Add AWS/WAFV2 metrics

* Fix AWS/ApplicationELB list

* Revert metrics deletion

* Fix ordering

* Add dimensions for the new services

* Add dimensions for the AWS/ECR
  • Loading branch information
andriikushch authored Aug 8, 2024
1 parent 7192edb commit 48b8ce9
Show file tree
Hide file tree
Showing 2 changed files with 131 additions and 5 deletions.
132 changes: 128 additions & 4 deletions pkg/cloudWatchConsts/metrics.go
Original file line number Diff line number Diff line change
Expand Up @@ -204,6 +204,7 @@ var NamespaceMetricsMap = map[string][]string{
},
"AWS/ApplicationELB": {
"ActiveConnectionCount",
"AnomalousHostCount",
"ClientTLSNegotiationErrorCount",
"ConsumedLCUs",
"DesyncMitigationMode_NonCompliant_Request_Count",
Expand Down Expand Up @@ -231,11 +232,14 @@ var NamespaceMetricsMap = map[string][]string{
"HTTP_Redirect_Count",
"HTTP_Redirect_Url_Limit_Exceeded_Count",
"HealthyHostCount",
"HealthyStateDNS",
"HealthyStateRouting",
"IPv6ProcessedBytes",
"IPv6RequestCount",
"LambdaInternalError",
"LambdaTargetProcessedBytes",
"LambdaUserError",
"MitigatedHostCount",
"NewConnectionCount",
"NonStickyRequestCount",
"ProcessedBytes",
Expand All @@ -248,6 +252,9 @@ var NamespaceMetricsMap = map[string][]string{
"TargetResponseTime",
"TargetTLSNegotiationErrorCount",
"UnHealthyHostCount",
"UnhealthyRoutingRequestCount",
"UnhealthyStateDNS",
"UnhealthyStateRouting",
},
"AWS/Athena": {
"EngineExecutionTime",
Expand Down Expand Up @@ -554,13 +561,27 @@ var NamespaceMetricsMap = map[string][]string{
"DBClusterReplicaLagMinimum",
"DBInstanceReplicaLag",
"DatabaseConnections",
"DatabaseConnectionsMax",
"DatabaseCursors",
"DatabaseCursorsMax",
"DatabaseCursorsTimedOut",
"DiskQueueDepth",
"DocumentsDeleted",
"DocumentsInserted",
"DocumentsReturned",
"DocumentsUpdated",
"EngineUptime",
"FreeLocalStorage",
"FreeableMemory",
"NetworkReceiveThroughput",
"NetworkThroughput",
"NetworkTransmitThroughput",
"OpcountersCommand",
"OpcountersDelete",
"OpcountersGetmore",
"OpcountersInsert",
"OpcountersQuery",
"OpcountersUpdate",
"ReadIOPS",
"ReadLatency",
"ReadThroughput",
Expand Down Expand Up @@ -705,6 +726,9 @@ var NamespaceMetricsMap = map[string][]string{
"TargetCapacity",
"TerminatingCapacity",
},
"AWS/ECR": {
"RepositoryPullCount",
},
"AWS/ECS": {
"CPUReservation",
"CPUUtilization",
Expand Down Expand Up @@ -1334,11 +1358,33 @@ var NamespaceMetricsMap = map[string][]string{
"BackupToS3.DataFreshness",
"BackupToS3.Records",
"BackupToS3.Success",
"BytesPerSecondLimit",
"DataReadFromKinesisStream.Bytes",
"DataReadFromKinesisStream.Records",
"DataReadFromSource.Backpressured",
"DataReadFromSource.Bytes",
"DataReadFromSource.Records",
"DeliveryToAmazonOpenSearchServerless.AuthFailure",
"DeliveryToAmazonOpenSearchServerless.Bytes",
"DeliveryToAmazonOpenSearchServerless.DataFreshness",
"DeliveryToAmazonOpenSearchServerless.DeliveryRejected",
"DeliveryToAmazonOpenSearchServerless.Records",
"DeliveryToAmazonOpenSearchServerless.Success",
"DeliveryToAmazonOpenSearchService.AuthFailure",
"DeliveryToAmazonOpenSearchService.Bytes",
"DeliveryToAmazonOpenSearchService.DataFreshness",
"DeliveryToAmazonOpenSearchService.DeliveryRejected",
"DeliveryToAmazonOpenSearchService.Records",
"DeliveryToAmazonOpenSearchService.Success",
"DeliveryToElasticsearch.Bytes",
"DeliveryToElasticsearch.Records",
"DeliveryToElasticsearch.Success",
"DeliveryToHttpEndpoint.Bytes",
"DeliveryToHttpEndpoint.DataFreshness",
"DeliveryToHttpEndpoint.ProcessedBytes",
"DeliveryToHttpEndpoint.ProcessedRecords",
"DeliveryToHttpEndpoint.Records",
"DeliveryToHttpEndpoint.Success",
"DeliveryToRedshift.Bytes",
"DeliveryToRedshift.Records",
"DeliveryToRedshift.Success",
Expand All @@ -1347,7 +1393,13 @@ var NamespaceMetricsMap = map[string][]string{
"DeliveryToS3.ObjectCount",
"DeliveryToS3.Records",
"DeliveryToS3.Success",
"DeliveryToSnowflake.Bytes",
"DeliveryToSnowflake.DataCommitLatency",
"DeliveryToSnowflake.DataFreshness",
"DeliveryToSnowflake.Records",
"DeliveryToSnowflake.Success",
"DeliveryToSplunk.Bytes",
"DeliveryToSplunk.DataAckLatency",
"DeliveryToSplunk.DataFreshness",
"DeliveryToSplunk.Records",
"DeliveryToSplunk.Success",
Expand All @@ -1357,16 +1409,24 @@ var NamespaceMetricsMap = map[string][]string{
"ExecuteProcessing.Success",
"FailedConversion.Bytes",
"FailedConversion.Records",
"FailedValidation.Bytes",
"FailedValidation.Records",
"IncomingBytes",
"IncomingPutRequests",
"IncomingRecords",
"JQProcessing.Duration",
"KMSKeyAccessDenied",
"KMSKeyDisabled",
"KMSKeyInvalidState",
"KMSKeyNotFound",
"KafkaOffsetLag",
"KinesisMillisBehindLatest",
"ListDeliveryStreams.Latency",
"ListDeliveryStreams.Requests",
"OutputDecompressedBytes.Failed",
"OutputDecompressedBytes.Success",
"OutputDecompressedRecords.Failed",
"OutputDecompressedRecords.Success",
"PartitionCount",
"PartitionCountExceeded",
"PerPartitionThroughput",
Expand All @@ -1377,13 +1437,18 @@ var NamespaceMetricsMap = map[string][]string{
"PutRecordBatch.Latency",
"PutRecordBatch.Records",
"PutRecordBatch.Requests",
"PutRequestsPerSecondLimit",
"RecordsPerSecondLimit",
"ResourceCount",
"SourceThrottled.Delay",
"SucceedConversion.Bytes",
"SucceedConversion.Records",
"SucceedProcessing.Bytes",
"SucceedProcessing.Records",
"ThrottledDescribeStream",
"ThrottledGetRecords",
"ThrottledGetShardIterator",
"ThrottledRecords",
"UpdateDeliveryStream.Latency",
"UpdateDeliveryStream.Requests",
},
Expand Down Expand Up @@ -1739,9 +1804,13 @@ var NamespaceMetricsMap = map[string][]string{
"PutRecord.Latency",
"PutRecord.Success",
"PutRecords.Bytes",
"PutRecords.FailedRecords",
"PutRecords.Latency",
"PutRecords.Records",
"PutRecords.Success",
"PutRecords.SuccessfulRecords",
"PutRecords.ThrottledRecords",
"PutRecords.TotalRecords",
"ReadProvisionedThroughputExceeded",
"SubscribeToShard.RateExceeded",
"SubscribeToShard.Success",
Expand Down Expand Up @@ -1916,6 +1985,21 @@ var NamespaceMetricsMap = map[string][]string{
"PredictCount",
"PredictFailureCount",
},
"AWS/MWAA": {
"ActiveConnectionCount",
"ApproximateAgeOfOldestTask",
"CPUUtilization",
"DatabaseConnections",
"DiskQueueDepth",
"FreeableMemory",
"MemoryUtilization",
"QueuedTasks",
"RunningTasks",
"VolumeWriteIOPS",
"WriteIOPS",
"WriteLatency",
"WriteThroughput",
},
"AWS/MediaConnect": {
"ARQRecovered",
"ARQRequests",
Expand Down Expand Up @@ -2279,19 +2363,38 @@ var NamespaceMetricsMap = map[string][]string{
},
"AWS/NetworkELB": {
"ActiveFlowCount",
"ActiveFlowCount_TCP",
"ActiveFlowCount_TLS",
"ActiveFlowCount_UDP",
"ClientTLSNegotiationErrorCount",
"ConsumedLCUs",
"ConsumedLCUs_TCP",
"ConsumedLCUs_TLS",
"ConsumedLCUs_UDP",
"HealthyHostCount",
"NewFlowCount",
"NewFlowCount_TCP",
"NewFlowCount_TLS",
"NewFlowCount_UDP",
"PeakPacketsPerSecond",
"PortAllocationErrorCount",
"ProcessedBytes",
"ProcessedBytes_TCP",
"ProcessedBytes_TLS",
"ProcessedBytes_UDP",
"ProcessedPackets",
"SecurityGroupBlockedFlowCount_Inbound_ICMP",
"SecurityGroupBlockedFlowCount_Inbound_TCP",
"SecurityGroupBlockedFlowCount_Inbound_UDP",
"SecurityGroupBlockedFlowCount_Outbound_ICMP",
"SecurityGroupBlockedFlowCount_Outbound_TCP",
"SecurityGroupBlockedFlowCount_Outbound_UDP",
"TCP_Client_Reset_Count",
"TCP_ELB_Reset_Count",
"TCP_Target_Reset_Count",
"TargetTLSNegotiationErrorCount",
"UnHealthyHostCount",
"UnhealthyRoutingFlowCount",
},
"AWS/NetworkFirewall": {
"DroppedPackets",
Expand Down Expand Up @@ -2569,6 +2672,7 @@ var NamespaceMetricsMap = map[string][]string{
"NumberOfNotificationsFailed",
"NumberOfNotificationsFilteredOut",
"NumberOfNotificationsFilteredOut-InvalidAttributes",
"NumberOfNotificationsFilteredOut-MessageBody",
"NumberOfNotificationsFilteredOut-NoMessageAttributes",
"PublishSize",
"SMSMonthToDateSpentUSD",
Expand Down Expand Up @@ -2656,6 +2760,16 @@ var NamespaceMetricsMap = map[string][]string{
"StepStopped",
"StepSucceeded",
},
"AWS/Scheduler": {
"InvocationAttemptCount",
"InvocationDroppedCount",
"InvocationThrottleCount",
"InvocationsFailedToBeSentToDeadLetterCount",
"InvocationsSentToDeadLetterCount",
"InvocationsSentToDeadLetterCount_Truncated_MessageSizeExceeded",
"TargetErrorCount",
"TargetErrorThrottledCount",
},
"AWS/ServiceCatalog": {
"ProvisionedProductLaunch",
},
Expand All @@ -2670,7 +2784,6 @@ var NamespaceMetricsMap = map[string][]string{
"ActivityScheduleTime",
"ActivityTime",
"ConsumedCapacity",
"ConsumedCapacity",
"ExecutionThrottled",
"ExecutionTime",
"ExecutionsAborted",
Expand Down Expand Up @@ -2804,8 +2917,14 @@ var NamespaceMetricsMap = map[string][]string{
"AWS/WAFV2": {
"AllowedRequests",
"BlockedRequests",
"CaptchaRequests",
"CaptchasAttempted",
"CaptchasSolved",
"ChallengeRequests",
"CountedRequests",
"PassedRequests",
"RequestsWithValidCaptchaToken",
"RequestsWithValidChallengeToken",
},
"AWS/WorkSpaces": {
"Available",
Expand Down Expand Up @@ -2864,6 +2983,10 @@ var NamespaceMetricsMap = map[string][]string{
"CpuUtilized",
"DeploymentCount",
"DesiredTaskCount",
"EBSFilesystemSize",
"EBSFilesystemUtilized",
"EphemeralStorageReserved",
"EphemeralStorageUtilized",
"MemoryReserved",
"MemoryUtilized",
"NetworkRxBytes",
Expand All @@ -2882,7 +3005,7 @@ var NamespaceMetricsMap = map[string][]string{
"instance_filesystem_utilization",
"instance_memory_limit",
"instance_memory_reserved_capacity",
"instance_memory_utliization",
"instance_memory_utilization",
"instance_memory_working_set",
"instance_network_total_bytes",
"instance_number_of_running_tasks",
Expand All @@ -2905,7 +3028,6 @@ var NamespaceMetricsMap = map[string][]string{
"glue.ALL.s3.filesystem.read_bytes",
"glue.ALL.s3.filesystem.write_bytes",
"glue.ALL.system.cpuSystemLoad",
"glue.ALL.system.cpuSystemLoad",
"glue.driver.BlockManager.disk.diskSpaceUsed_MB",
"glue.driver.ExecutorAllocationManager.executors.numberAllExecutors",
"glue.driver.ExecutorAllocationManager.executors.numberMaxNeededExecutors",
Expand Down Expand Up @@ -2946,7 +3068,6 @@ var NamespaceMetricsMap = map[string][]string{
"glue.driver.streaming.batchProcessingTimeInMs",
"glue.driver.streaming.numRecords",
"glue.driver.system.cpuSystemLoad",
"glue.driver.system.cpuSystemLoad",
"glue.driver.workerUtilization",
"glue.error.ALL",
"glue.succeed.ALL",
Expand Down Expand Up @@ -3083,4 +3204,7 @@ var NamespaceDimensionKeysMap = map[string][]string{
"AWS/Cassandra": {"Keyspace", "Operation", "TableName"},
"AWS/AmplifyHosting": {"App"},
"CloudWatchSynthetics": {"CanaryName", "StepName"},
"AWS/Scheduler": {"ScheduleGroup"},
"AWS/MWAA": {"Cluster", "Queue", "Database"},
"AWS/ECR": {"RepositoryName"},
}
4 changes: 3 additions & 1 deletion pkg/cloudWatchConsts/metrics_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ package cloudWatchConsts
import (
"fmt"
"github.com/stretchr/testify/assert"
"slices"
"sort"
"testing"
)
Expand Down Expand Up @@ -30,8 +31,9 @@ func printSortedNamespaceMetricsMapAsGoMap() {
for _, k := range keys {
metrics := NamespaceMetricsMap[k]
sort.Strings(metrics)
uniqMetrics := slices.Compact(metrics)
fmt.Printf(" \"%s\": {\n", k)
for _, metric := range metrics {
for _, metric := range uniqMetrics {
fmt.Printf(" \"%s\",\n", metric)
}
fmt.Println(" },")
Expand Down

0 comments on commit 48b8ce9

Please sign in to comment.