Dabz / ccloudexporter

Prometheus exporter for Confluent Cloud API metric
https://docs.confluent.io/current/cloud/metrics-api.html
87 stars 53 forks source link

Omit `agg` attribute from request #84

Closed sirianni closed 3 years ago

sirianni commented 3 years ago

Omit the agg attribute from the Confluent Cloud Metrics API request instead of hardcoding agg: "SUM".

The agg attribute has been optional in Metrics API for 8+ months. If agg is not specified it defaults to the required aggregation for the metric. Until recently, all of the metrics required the SUM aggregation. However, new metrics are being added that use other aggregations (e.g. MAX). By hardcoding agg: "SUM", we will get an error if we try to query such a metric. By omitting the agg field, we are able to query the metric properly.

Dabz commented 3 years ago

Thanks for the information, I was not aware of this behavior. The PR looks good to me. Let me merge it. Thanks a lot @sirianni :-)