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.
Omit the
agg
attribute from the Confluent Cloud Metrics API request instead of hardcodingagg: "SUM"
.The
agg
attribute has been optional in Metrics API for 8+ months. Ifagg
is not specified it defaults to the required aggregation for the metric. Until recently, all of the metrics required theSUM
aggregation. However, new metrics are being added that use other aggregations (e.g.MAX
). By hardcodingagg: "SUM"
, we will get an error if we try to query such a metric. By omitting theagg
field, we are able to query the metric properly.