Description
Bug description:
With the below configuration to collect metrics from AWS/Apigateway and include the tags for the restapis service.
metrics:
- namespace: "AWS/ApiGateway"
resource_type: apigateway:restapis
However, It was detected that the tags are not being collected for such resource type.
Version: 8.4.3
Steps to Reproduce:
- we collect all the tags for a given resource type
- we obtain a list of resource ARNs of the given type
- from the above list we extract from the ARNs the resource information and collect them with their related tags
- we then collect the metrics for the namespace
- we obtain a list of metrics with their dimensions, that usually include the resource information part of the ARN
- we match the resource information part of the ARN in the metrics list with the one from the collection of tags
This proofed to work for EC2, RDS etc and in general all the predefined module we have in metricbeat, but does not seem to work for restapis: that's because the information in the metrics dimensions and the information in the tag list, related to the resource, it's different
Here's an example from EC2, see the matching of the two values highlighted:
Here's the same from restapi, see how the subIdentifier (the information coming from metrics dimentions) is the name of the rest api, but the resource information in the tags collection coming from the ARN does not match: