Skip to content

Commit

Permalink
Update AWS docs to clarify tag filtering configuration (#32435)
Browse files Browse the repository at this point in the history
* update docs to clarify tag filtering configuration

* commit the results of 'make update'
  • Loading branch information
tommyers-elastic authored Jul 25, 2022
1 parent e362ca7 commit 96f67e8
Show file tree
Hide file tree
Showing 3 changed files with 43 additions and 27 deletions.
23 changes: 16 additions & 7 deletions metricbeat/docs/modules/aws.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,17 @@ the `endpoint-code` part, such as `amazonaws.com`, `amazonaws.com.cn`, `c2s.ic.g

If endpoint is specified, `regions` config becomes required. For example:

* *tags_filter*

The tags to filter against. If tags are given in config, then only
collect metrics from resources that have tag key and tag value matches the filter.
For example, if tags parameter is given as `Organization=Engineering` under
`AWS/ELB` namespace, then only collect metrics from ELBs with tag name equals to
`Organization` and tag value equals to `Engineering`.

Note: tag filtering only works for metricsets with `resource_type` specified in the
metricset-specific configuration.

[source,yaml]
----
- module: aws
Expand All @@ -68,6 +79,9 @@ If endpoint is specified, `regions` config becomes required. For example:
regions: cn-north-1
metricsets:
- ec2
tags_filter:
- key: "Organization"
value: "Engineering"
----

* *fips_enabled*
Expand Down Expand Up @@ -95,15 +109,10 @@ image::./images/metricbeat-aws-overview.png[]
[float]
== Metricsets

Currently, we have `billing`, `cloudwatch`, `dynamodb`, `ebs`, `ec2`, `elb`,
`lambda`, `natgateway`, `rds`, `s3_daily_storage`, `s3_request`, `sns`, `sqs`,
Currently, we have `billing`, `cloudwatch`, `dynamodb`, `ebs`, `ec2`, `elb`, `kinesis`
`lambda`, `mtest`, `natgateway`, `rds`, `s3_daily_storage`, `s3_request`, `sns`, `sqs`,
`transitgateway`, `usage` and `vpn` metricset in `aws` module.

Collecting `tags` for `ec2`, `rds`, `cloudwatch`, and metricset created based on
`cloudwatch` using light module is supported.

* *tags.*: Tag key value pairs from aws resources. A tag is a label that user assigns to an AWS resource.

[float]
=== `billing`
Billing metric data includes the estimated charges for every service in the AWS
Expand Down
23 changes: 16 additions & 7 deletions x-pack/metricbeat/module/aws/_meta/docs.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,17 @@ the `endpoint-code` part, such as `amazonaws.com`, `amazonaws.com.cn`, `c2s.ic.g

If endpoint is specified, `regions` config becomes required. For example:

* *tags_filter*

The tags to filter against. If tags are given in config, then only
collect metrics from resources that have tag key and tag value matches the filter.
For example, if tags parameter is given as `Organization=Engineering` under
`AWS/ELB` namespace, then only collect metrics from ELBs with tag name equals to
`Organization` and tag value equals to `Engineering`.

Note: tag filtering only works for metricsets with `resource_type` specified in the
metricset-specific configuration.

[source,yaml]
----
- module: aws
Expand All @@ -56,6 +67,9 @@ If endpoint is specified, `regions` config becomes required. For example:
regions: cn-north-1
metricsets:
- ec2
tags_filter:
- key: "Organization"
value: "Engineering"
----

* *fips_enabled*
Expand Down Expand Up @@ -83,15 +97,10 @@ image::./images/metricbeat-aws-overview.png[]
[float]
== Metricsets

Currently, we have `billing`, `cloudwatch`, `dynamodb`, `ebs`, `ec2`, `elb`,
`lambda`, `natgateway`, `rds`, `s3_daily_storage`, `s3_request`, `sns`, `sqs`,
Currently, we have `billing`, `cloudwatch`, `dynamodb`, `ebs`, `ec2`, `elb`, `kinesis`
`lambda`, `mtest`, `natgateway`, `rds`, `s3_daily_storage`, `s3_request`, `sns`, `sqs`,
`transitgateway`, `usage` and `vpn` metricset in `aws` module.

Collecting `tags` for `ec2`, `rds`, `cloudwatch`, and metricset created based on
`cloudwatch` using light module is supported.

* *tags.*: Tag key value pairs from aws resources. A tag is a label that user assigns to an AWS resource.

[float]
=== `billing`
Billing metric data includes the estimated charges for every service in the AWS
Expand Down
24 changes: 11 additions & 13 deletions x-pack/metricbeat/module/aws/cloudwatch/_meta/docs.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -28,11 +28,6 @@ For example, specifying a resource type of ec2 returns all Amazon EC2 resources
only EC2 instances.
* *statistic*: Statistics are metric data aggregations over specified periods of time.
By default, statistic includes Average, Sum, Count, Maximum and Minimum.
* *tags*: The tags to filter against. If tags are given in config, then only
collect metrics from resources that have tag key and tag value matches the filter.
For example, if tags parameter is given as `Organization=Engineering` under
`AWS/ELB` namespace, then only collect metrics from ELBs with tag name equals to
`Organization` and tag value equals to `Engineering`.

[float]
=== Configuration examples
Expand All @@ -49,14 +44,14 @@ in configurations in order for this metricset to make proper AWS API calls.
period: 300s
metricsets:
- cloudwatch
tags_filter: <3>
- key: "Organization"
value: "Engineering"
metrics:
- namespace: AWS/EBS <1>
- namespace: AWS/ELB <2>
resource_type: elasticloadbalancing
tags:
- key: "Organization"
value: "Engineering"
- namespace: AWS/EC2 <3>
- namespace: AWS/EC2 <4>
name: CPUUtilization
statistic: ["Average"]
dimensions:
Expand All @@ -68,11 +63,14 @@ in configurations in order for this metricset to make proper AWS API calls.
specific namespace, such as `AWS/EBS`.

<2> `cloudwatch` metricset also has the ability to collect tags from AWS resources.
If user specify `resource_type`, then tags will be collected and stored
If `resource_type` is specified, then tags will be collected and stored
as a part of the event. Please see https://docs.aws.amazon.com/resourcegroupstagging/latest/APIReference/API_GetResources.html[AWS API GetResources]
for more details about `resource_type`.
for more details about `resource_type`.

<3> If users knows exactly what are the cloudwatch metrics they want to collect,
<3> If tags are collected (for metricsets with `resource_type` specified), events can also
be filtered by tag, using the `tags_filter` field in the module-specific configuration.

<4> If users knows exactly what are the cloudwatch metrics they want to collect,
this configuration format can be used. `namespace` and `metricname` need to be
specified and `dimensions` can be used to filter cloudwatch metrics. Please see
https://docs.aws.amazon.com/cli/latest/reference/cloudwatch/list-metrics.html[AWS List Metrics]
Expand Down Expand Up @@ -211,5 +209,5 @@ be any.
value: "*"
- name: TargetGroup
value: "*"
tags.resource_type_filter: elasticloadbalancing
resource_type: elasticloadbalancing
----

0 comments on commit 96f67e8

Please sign in to comment.