-
Notifications
You must be signed in to change notification settings - Fork 4.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Metricbeat not collecting tags for AWS - Apigateway resource_type:restapis
#33913
Comments
I've investigated this a bit more. Before delving into the logic of this, I think there is a workaround: configure Now to the logic of how this work:
From the pictures above, is clear there is no correlation between the event identifier (and extracted sub-identifiers) and the tag identifier as extracted by I still have to explore how the metric identifier generation works and if we can solve this by changing the metric identifier instead of the tag identifier. |
Updates on my investigation. TLDR: this is not possible to fix in its entirety but there are a couple of workarounds worth exploring that would help mitigating the problem. Why it can't be fixed?As mentioned in the previous comments, there is no data to match the metric data and the tags. The identifier used by the metrics comes from metric labels:
API Gateway API name is used, no other identifiable information is available. On the other hand, tags are collected separately. When they are matched with the incoming metrics, this is an example situation:
The fourth index is used as metric identifier, resulting in Nowhere in the logic the code knows the ID of the API Gateway, thus we can conclude that there is no way to match the API Gateway metric with the appropriate labels. To workaround this it should be possible to match API Gateways names with Ids through This would work but API Gateways can have the duplicated names (as uniqueness is guaranteed from the ID). Thus univocally matching an API Gateway metric to a tag is not possible. SolutionAWS APIs response contains the Rest API ID. Workaround 1When Pitfall: does not work when there are multiple API Gateway with the same name. Workaround 2We request customers to apply a tag to the API Gateway resource. The tag must have an unique and known Key, which we use to find the appropriate tags in the Pitfall: is unpredictable if there are multiple API Gateway with the same name. |
resource_type:restapis
hey thanks edo and andrea for the investigations into this so far. from my point of view, neither of the workarounds presented here really offer a great solution for the user. i think for the time being we should document this as a known limitation of the integration and we should follow up with AWS to see if we can find a solution to getting the restapi ID, instead of the name. let's park any further work on this for now. |
This comment was marked as off-topic.
This comment was marked as off-topic.
Agreed, the workarounds don't work for us either. Would be great to hear how you get on with AWS. |
After analysis done in https://github.com/elastic/sdh-beats/issues/5103#issuecomment-2333853534, we had made the decision to enhance the currentl cloudwatch module with The idea is to check the namespace and if is namespace: "AWS/ApiGateway", then trigger the The working branch: https://github.com/elastic/beats/tree/awscloudwatchtags |
Reopening as #40755 has been reverted. CI started failing after that was merged; it doesn't look likely that it's specific to the change, but all the same Beats CI needed to be stabilised. |
@axw - any suggestions on where the problem might be here, that required the revert? Just keen to get an idea whether the merge will be applied again in the near-term or rather requires deeper investigation. |
@damianpfister as far as I know, investigation is ongoing (#41087 (comment)). @gizas is that right? |
Indeed investigation is ongoing and I dont have any new update. I will try to see if I can find anything |
@damianpfister still investigation is ongoing: #41270 |
@damianpfister @gizas the investigation is over and the linker problem was solved, see #41270 (comment) #40755 can be re-applied again. |
Bug description:
With the below configuration to collect metrics from AWS/Apigateway and include the tags for the restapis service.
However, It was detected that the tags are not being collected for such resource type.
Version: 8.4.3
Steps to Reproduce:
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:
The text was updated successfully, but these errors were encountered: