Confluent Version 2 API
 Version 2 of the Metrics API adds the ability to query metrics for Kafka Connect, ksqlDB, and Schema Registry. This capability is enabled by the introduction of a [Resource](#section/Object-Model/Resources) abstraction into the API object model. Resources represent the entity against which metrics are collected. ### Migration Guide The following endpoint URLs have changed in version 2: | Endpoint | Version 1 (Sunset) | Version 2 | | ----------------------- | -------------------------------- | ---------------------------------------- | | Metrics discovery | `/metrics/{dataset}/descriptors` | `/metrics/{dataset}/descriptors/metrics` | The label prefix syntax has changed in version 2: | Label | Version 1 (Sunset) | Version 2 | | ----------------------- | ---------------------------- | ----------------------- | | Resource labels *(new)* | *N/A* | `resource.` | | Kafka cluster ID | `metric.label.cluster_id` | `resource.kafka.id` | | All other metric labels | `metric.label.` | `metric.` | This example shows a request to `/v1/metrics/cloud/query` migrated into the new `v2` syntax #### Version 1 Request ```json { "group_by": [ "metric.label.topic" ], "aggregations": [{ "metric": "io.confluent.kafka.server/received_bytes", "agg": "SUM" }], "filter": { "field": "metric.label.cluster_id", "op": "EQ", "value": "lkc-00000" }, "granularity": "ALL", "intervals" : [ "2020-01-01T00:00:00Z/PT1H" ] } ``` #### Version 2 Request ```json { "group_by": [ "metric.topic" ], "aggregations": [{ "metric": "io.confluent.kafka.server/received_bytes", "agg": "SUM" }], "filter": { "field": "resource.kafka.id", "op": "EQ", "value": "lkc-00000" }, "granularity": "ALL", "intervals" : [ "2020-01-01T00:00:00Z/PT1H" ] } ```