Skip to content
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

use_get_metric_data not working with the latest version (0.14.0) of Cloudwatch Exporter #434

Closed
sandeepnethi opened this issue Jun 7, 2022 · 3 comments
Labels

Comments

@sandeepnethi
Copy link

sandeepnethi commented Jun 7, 2022

Hi,

I was trying to evaluate this exporter and found that the experimental flag use_get_metric_data is not working as stated in the instructions and throwing below error when trying to call metrics endpoint.

my exporter config is as below. I have double checked the syntax for this flag from the codebase and I don't see any issues. Please let me know what could be wrong here.

region: us-east-1
metrics:
- aws_namespace: AWS/EC2
  use_get_metric_data: true
  aws_metric_name: CPUUtilization
  aws_dimensions: [InstanceId]
  aws_tag_select:
    resource_type_selection: ec2:instance
    resource_id_dimension: InstanceId

java.lang.NoSuchMethodError: 'java.util.List java.util.stream.Stream.toList()' at io.prometheus.cloudwatch.GetMetricDataDataGetter.buildStatsList(GetMetricDataDataGetter.java:50) at io.prometheus.cloudwatch.GetMetricDataDataGetter.buildMetricDataQueries(GetMetricDataDataGetter.java:61) at io.prometheus.cloudwatch.GetMetricDataDataGetter.buildMetricDataRequests(GetMetricDataDataGetter.java:127) at io.prometheus.cloudwatch.GetMetricDataDataGetter.fetchAllDataPoints(GetMetricDataDataGetter.java:138) at io.prometheus.cloudwatch.GetMetricDataDataGetter.<init>(GetMetricDataDataGetter.java:181) at io.prometheus.cloudwatch.CloudWatchCollector.scrape(CloudWatchCollector.java:586) at io.prometheus.cloudwatch.CloudWatchCollector.collect(CloudWatchCollector.java:690) at io.prometheus.client.Collector.collect(Collector.java:46) at io.prometheus.client.CollectorRegistry$MetricFamilySamplesEnumeration.findNextElement(CollectorRegistry.java:197) at io.prometheus.client.CollectorRegistry$MetricFamilySamplesEnumeration.nextElement(CollectorRegistry.java:212) at io.prometheus.client.CollectorRegistry$MetricFamilySamplesEnumeration.nextElement(CollectorRegistry.java:152) at io.prometheus.client.exporter.common.TextFormat.write004(TextFormat.java:71) at io.prometheus.client.exporter.common.TextFormat.writeFormat(TextFormat.java:53) at io.prometheus.client.servlet.common.exporter.Exporter.doGet(Exporter.java:75) at io.prometheus.client.exporter.MetricsServlet.doGet(MetricsServlet.java:52)

Thanks,

@gautam-wadhwa-wday
Copy link

I hit this issue as well, and on closer inspection, the reason is most likely that you are using a version of the JDK which doesn't have the following method: https://docs.oracle.com/en/java/javase/16/docs/api/java.base/java/util/stream/Stream.html#toList()

The fix for this is to use a JDK which does have the aforementioned method (JDK 16 or later)

@or-shachar
Copy link
Contributor

Thanks for reporting this!

Pretty sure I fixed it in recent commits:

91ce138#diff-2a2be6857e8c6dd575a5dfc1a22cdd8803adb9d5706df9f7ee223f722d2ec81dR52

Maybe we need to release a new version @matthiasr

@matthiasr
Copy link
Contributor

Done!

Note that this has some (medium) CVEs in Netty, I'm already working on another update but waiting for CircleCI to work through a backlog.

@matthiasr matthiasr added the bug label Jun 8, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

4 participants