diff --git a/aws/cloudstream/apigateway/apigateway.hcl b/aws/cloudstream/apigateway/apigateway.hcl new file mode 100644 index 0000000..ca98d72 --- /dev/null +++ b/aws/cloudstream/apigateway/apigateway.hcl @@ -0,0 +1,38 @@ +scraper aws_apigateway_cloudstream module { + frequency = 60 + lookback = 600 + timeout = 30 + resolution = 60 + lag = 60 + + gauge "throughput" { + source promql "throughput" { + query = "sum by (ApiName) (amazonaws_com_AWS_ApiGateway_Count_count{ApiName=~'${join("|", resources.all.ApiName)}', Namespace!=''})" + } + } + + gauge "4XX" { + source promql "4XX" { + query = "sum by (ApiName) (amazonaws_com_AWS_ApiGateway_4XXError_count{ApiName=~'${join("|", resources.all.ApiName)}', Namespace!=''})" + } + } + + gauge "5XX" { + source promql "5XX" { + query = "sum by (ApiName) (amazonaws_com_AWS_ApiGateway_5XXError_count{ApiName=~'${join("|", resources.all.ApiName)}', Namespace!=''})" + } + } + + gauge "latency" { + source promql "latency" { + query = "sum by (ApiName) (amazonaws_com_AWS_ApiGateway_Latency_count{ApiName=~'${join("|", resources.all.ApiName)}', Namespace!=''})" + } + } + + gauge "integration_latency" { + source promql "integration_latency" { + query = "sum by (ApiName) (amazonaws_com_AWS_ApiGateway_IntegrationLatency_count{ApiName=~'${join("|", resources.all.ApiName)}', Namespace!=''})" + } + } +} + diff --git a/sample/ome/rds.hcl b/sample/ome/rds.hcl index 583a7d4..2c9fd10 100644 --- a/sample/ome/rds.hcl +++ b/sample/ome/rds.hcl @@ -17,10 +17,10 @@ var rds_tags { } extends aws_rds_cloudwatch "my-rds" { - resources = var.rds - label_set = var.rds_tags + resources = var.rds + label_set = var.rds_tags module_uri = "https://github.com/last9/openmetrics-registry/releases/download/v0.0.1/aws_cloudwatch_rds_v0.0.1.hcl" using = { - default = "ap-south-1" + default = "ap-south-1" } }