From e528d2161b05b6329f8885b6c7db8bcff5e301e0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?M=C3=A5rten=20Svantesson?= Date: Mon, 4 Mar 2024 15:13:21 +0100 Subject: [PATCH] docs: updated README.md and a couple of examples MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: MÃ¥rten Svantesson --- README.md | 1 + examples/ApplicationELB.yml | 16 ++++++++++++++-- examples/WAFV2.yml | 11 +++++++++++ 3 files changed, 26 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 336236f8..15e1d133 100644 --- a/README.md +++ b/README.md @@ -79,6 +79,7 @@ aws_tag_select | Optional. A tag configuration to filter on, based on mapping fr tag_selections | Optional, under `aws_tag_select`. Specify a map from a tag key to a list of tag values to apply [tag filtering](https://docs.aws.amazon.com/resourcegroupstagging/latest/APIReference/API_GetResources.html#resourcegrouptagging-GetResources-request-TagFilters) on resources from which metrics will be gathered. resource_type_selection | Required, under `aws_tag_select`. Specify the [resource type](https://docs.aws.amazon.com/general/latest/gr/aws-arns-and-namespaces.html#genref-aws-service-namesspaces) to filter on. `resource_type_selection` should be comprised as `service:resource_type`, as per the [resource group tagging API](https://docs.aws.amazon.com/resourcegroupstagging/latest/APIReference/API_GetResources.html#resourcegrouptagging-GetResources-request-TagFilters). Where `resource_type` could be an empty string, like in S3 case: `resource_type_selection: "s3:"`. resource_id_dimension | Required, under `aws_tag_select`. For the current metric, specify which CloudWatch dimension maps to the ARN [resource ID](https://docs.aws.amazon.com/general/latest/gr/aws-arns-and-namespaces.html#arns-syntax). + arn_resource_id_regexp | If the Cloudwatch dimension specified in `resource_id_dimension` doesn't conform to the convention for resource ID an alternative regular expression to extract the resource ID from the ARN can be given here. The default is `(?:([^:/]+)|[^:/]+/([^:]+))$`. The first non empty match group will be used. aws_statistics | Optional. A list of statistics to retrieve, values can include Sum, SampleCount, Minimum, Maximum, Average. Defaults to all statistics unless extended statistics are requested. aws_extended_statistics | Optional. A list of extended statistics to retrieve. Extended statistics currently include percentiles in the form `pN` or `pN.N`. delay_seconds | Optional. The newest data to request. Used to avoid collecting data that has not fully converged. Defaults to 600s. Can be set globally and per metric. diff --git a/examples/ApplicationELB.yml b/examples/ApplicationELB.yml index 575b222f..bb7f8a89 100644 --- a/examples/ApplicationELB.yml +++ b/examples/ApplicationELB.yml @@ -4,8 +4,20 @@ metrics: aws_metric_name: HealthyHostCount aws_dimensions: - LoadBalancer - aws_statistics: - - Sum + - TargetGroup + aws_statistics: + - Minimum + # In case you want to use some tag to select target group to monitor, or to have additional `info` metric + # with all target group tags as labels, use `aws_tag_select`. + # Since the TargetGroup dimension doesn't follow the convention for how to extract resource ids from ARN + # `arn_resource_id_regexp` is specified with an alternative regular expression. + aws_tag_select: + resource_type_selection: elasticloadbalancing:targetgroup + resource_id_dimension: TargetGroup + arn_resource_id_regexp: "(targetgroup/.*)$" + tag_selections: + Environment: + - production - aws_namespace: AWS/ApplicationELB aws_metric_name: UnHealthyHostCount aws_dimensions: diff --git a/examples/WAFV2.yml b/examples/WAFV2.yml index 126d1ee2..00aed43f 100644 --- a/examples/WAFV2.yml +++ b/examples/WAFV2.yml @@ -9,6 +9,17 @@ metrics: aws_namespace: AWS/WAFV2 aws_statistics: - Sum + # In case you want to use some tag to select web acls to monitor, or to have additional `info` metric + # with all web acl tags as labels, use `aws_tag_select`. + # Since the WebACL dimension doesn't follow the convention for how to extract resource ids from ARN + # `arn_resource_id_regexp` is specified with an alternative regular expression. + aws_tag_select: + resource_type_selection: wafv2:regional/webacl + resource_id_dimension: WebACL + arn_resource_id_regexp: "([^/]+)/[^/]+$" + tag_selections: + Environment: + - production - aws_dimensions: - Region - Rule