Confluent Version 2 API

![generally-available](https://img.shields.io/badge/Lifecycle%20Stage-Generally%20Available-%230074A2) 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" ] } ```

Operations 6

GET /v2/metrics/{dataset}/descriptors/metrics List metric descriptors
GET /v2/metrics/{dataset}/descriptors/resources List resource descriptors
POST /v2/metrics/{dataset}/query Query metric values
GET /v2/metrics/{dataset}/export Export metric values
POST /v2/metrics/{dataset}/attributes Query label values
GET /v2/metrics/{dataset}/discovery Discover target resources

Work with this as data

Every API here is available over the APIs.io API and to AI agents over MCP.

MCP server

One button, every client — Claude, Cursor, VS Code and the rest.

https://apis.io/mcp

Tools for apis

7 MCP tools reach this
  • find_apisBrowse and filter every API in the catalog.
  • get_api_artifactsOne API's artifacts, grouped by type.
  • get_openapiThe primary OpenAPI for this API.
  • find_similar_apisAPIs that look like this one.
  • apis_io_searchSTART HERE — APIs, providers and tags for one query, each with its total.
  • resolveTurn a domain, URL or GitHub org into the provider it belongs to.
  • find_cohortsEvery scored population of providers in the catalog.
All 92 tools →

Call it yourself

curl for this page
This API
curl "https://apis.io/api/v1/apis/confluent-version-2-api"
All apis
curl "https://apis.io/api/v1/apis?limit=25"

Discovery needs no key. Ratings and market analysis are Pro.

Get an API key

Free tier, no email required.

A second provider on the same verified email joins the account you already have.

OpenAPI Specification

confluent-version-2-api-openapi.yml Raw ↑
openapi: 3.2.0
info:
  contact:
    name: Confluent
    url: https://confluent.io
    email: support@confluent.io
  description: "# Introduction\n\nThe Confluent Cloud Metrics API provides actionable operational metrics about your Confluent\nCloud deployment. This is a queryable HTTP API in which the user will `POST` a query written in\nJSON and get back a time series of metrics specified by the query.\n\nComprehensive documentation is available on\n[docs.confluent.io](https://docs.confluent.io/current/cloud/metrics-api.html).\n\n# Available Metrics Reference\n\n<h3 style=\"margin-top: 0;\">Please see the <a href=\"/docs/descriptors\">Metrics Reference</a> for\na list of available metrics.</h3>\n\nThis information is also available programmatically via the\n[descriptors endpoint](#tag/Version-2/paths/~1v2~1metrics~1{dataset}~1descriptors~1metrics/get).\n\n# Authentication\nConfluent uses API keys for integrating with Confluent Cloud. Applications must be\nauthorized and authenticated before they can access or manage resources in Confluent Cloud.\nYou can manage your API keys in the Confluent Cloud Dashboard or Confluent Cloud CLI.\n\nAn API key is owned by a User or Service Account and inherits the permissions granted\nto the owner.\n\nToday, you can divide API keys into two classes:\n\n* **Cloud API Keys** - These grant access to the Confluent Cloud Control Plane APIs,\n  such as for Provisioning and Metrics integrations.\n* **Cluster API Keys** - These grant access to a single Confluent cluster, such as a specific\n  Kafka or Schema Registry cluster.\n\n**If you are going to use an API Key, you must use a Cloud API Key**. Cluster API Keys won't\nwork. Cloud API Keys can be created using the [Confluent Cloud CLI](https://docs.confluent.io/current/cloud/cli/).\n\n```\nccloud api-key create --resource cloud\n```\n\nAll API requests must be made over HTTPS. Calls made over plain HTTP will fail. API requests\nwithout authentication will also fail.\n\nThe Confluent Cloud Metrics API also supports OAuth 2.0 by allowing Confluent Security Token Service (STS) tokens as\ncredentials to authenticate to metrics API. See steps to\n[Authenticate access to Confluent Cloud APIs using Confluent STS tokens](https://docs.confluent.io/cloud/current/access-management/authenticate/oauth/access-rest-apis-sts.html#authenticate-access-to-ccloud-apis-using-confluent-security-token-service-sts-tokens)\n\n# Versioning\n\nConfluent APIs ensure stability for your integrations by avoiding the introduction\nof breaking changes to customers unexpectedly. Confluent will make non-breaking\nAPI changes without advance notice. Thus, API clients **must** follow the\n[Compatibility Policy](#section/Versioning/Compatibility-Policy) below to ensure your\ningtegration remains stable. All APIs follow the API Lifecycle Policy described below,\nwhich describes the guarantees API clients can rely on.\n\nBreaking changes will be [widely communicated](#communication) in advance in accordance\nwith our [Deprecation Policy](#section/Versioning/Deprecation-Policy). Confluent will provide\ntimelines and a migration path for all API changes, where available. Be sure to subscribe\nto one or more [communication channels](#communication) so you don't miss any updates!\n\nOne exception to these guidelines is for critical security issues. We will take any necessary\nactions to mitigate any critical security issue as soon as possible, which may include disabling\nthe vulnerable functionality until a proper solution is available.\n\nDo not consume any Confluent API unless it is documented in the API Reference. All undocumented\nendpoints should be considered private, subject to change without notice, and not covered by any\nagreements.\n\n> Note: The \"v1\" in the URL is not a \"major version\" in the\n[Semantic Versioning](https://semver.org/) sense. It is a \"generational version\" or\n\"meta version\", as seen in other APIs like\n<a href=\"https://developer.github.com/v3/versions/\" target=\"_blank\">Github API</a> or the\n<a href=\"https://stripe.com/docs/api/versioning\" target=\"_blank\">Stripe API</a>.\n\n## Changelog\n\n### 2026-06-18\n\n#### Improved metric data freshness from 5 minutes to 3 minutes\nWe have improved the freshness of our metric data from 5 minutes to 3 minutes. Metric data\npoints are now available to the organisation within 3 minutes through the export endpoint.\nThis is a fully backwards-compatible update that requires no action or changes from your end,\nso users utilizing the export endpoint for integrations like Grafana and Prometheus will see\nthis performance improvement automatically.\n\n### 2026-05-21\n\n#### `/export` per-metric return limit raised to 60,000 data points\nThe Metrics API /export endpoint now returns up to 60,000 data points per resource type\nper metric, increased from the previous limit of 30,000. Responses that previously\ntruncated at 30,000 unique label combinations per metric will now include up to 60,000\nbefore truncation. No client-side change is required.\n\n### 2026-04-16\n\n#### Partial success responses for `/export` endpoint\nThe Metrics API now returns partial success responses when requests include\ninaccessible resources, such as deleted or unauthorized resources, instead of failing\nthe entire request with a 403 Forbidden HTTP status code. A `confluent_scrape_resource_access_error`\ngauge metric is included in the response for each queried resource, with a value of `1` for\ninaccessible resources and `0` for accessible ones. If all requested resources are inaccessible,\nthe request fails with a 403 Forbidden HTTP status code.\n\n### 2025-10-09\n\n#### Begin six month notice of forthcoming API behavior change.\nOn April 9, 2026, the Metrics API will start returning partial success\nresponses when requests include inaccessible resources, such as, deleted or unauthorized resources, instead of failing\nthe entire request with 403 Forbidden HTTP status code. For more information, see\n<a href=\"https://support.confluent.io/hc/en-us/articles/41580380650516-Upcoming-Improvement-to-the-Confluent-Cloud-Metrics-API-export-Endpoint\" target=\"_blank\">\nUpcoming Improvement to the Confluent Cloud Metrics API /export Endpoint</a>.\n\n### 2022-12-01\n\n#### The dataset `health-plus` is now available in preview.\nSee the [Datasets](#section/Object-Model/Datasets) section for more details.\n\n### 2022-10-18\n\n#### `cluster_active_link_count` metric is deprecated\nThe `io.confluent.kafka.server/cluster_active_link_count` is now deprecated. Please use the\n`io.confluent.kafka.server/cluster_link_count` metric instead.\n\n#### New metrics available in `/export`\nThe following metrics are now available in the `/export` endpoint:\n* `io.confluent.kafka.server/request_bytes`\n* `io.confluent.kafka.server/response_bytes`\n* `io.confluent.kafka.server/cluster_link_destination_response_bytes`\n* `io.confluent.kafka.server/cluster_link_source_response_bytes`\n* `io.confluent.kafka.server/cluster_link_count`\n* `io.confluent.kafka.server/cluster_link_mirror_topic_count`\n* `io.confluent.kafka.server/cluster_link_mirror_topic_offset_lag`\n* `io.confluent.kafka.server/cluster_link_mirror_topic_bytes`\n\n### 2022-10-17\n\n#### API Version 1 is marked sunset\nAll API Version 1 endpoints are no longer supported from 2022-10-17. API users\nshould migrate to API [Version 2](#tag/Version-2).\n\n### 2021-09-23\n\n#### API Version 1 is now deprecated\nAll API Version 1 endpoints are now deprecated and will be removed on 2022-04-04. API users\nshould migrate to API [Version 2](#tag/Version-2).\n\n### 2021-08-24\n\n#### Metric-specific aggregation functions\nNew metrics are being introduced that require alternative aggregation functions (e.g. `MAX`).\nWhen querying those metrics, using `agg: \"SUM\"` will return an error.\nIt is recommended that clients **omit the `agg` field in the request** such that the required\naggregation function for the specific metric is automatically applied on the backend.\n\n> Note: The initial version of Metrics API required clients to effectively hardcode `agg: \"SUM\"`\n> in all queries.  In early 2021, the `agg` field was made optional, but many clients have not\n> been updated to omit the `agg` field.\n\n#### Cursor-based pagination for `/query` endpoint\nThe `/query` endpoint now supports cursor-based pagination similar to the `/descriptors` and\n`/attributes` endpoints.\n\n### 2021-02-10\n\n#### API Version 2 is now Generally Available (GA)\nSee the [Version 2](#tag/Version-2) section below for a detailed description of changes and\nmigration guide.\n\n### 2020-12-04\n\n#### API Version 2 *(Preview)*\nVersion 2 of the Metrics API is now available in Preview. See the [Version 2](#tag/Version-2)\nsection below for a detailed description of changes.\n\n### 2020-07-08\n\n#### Correction for `active_connection_count` metric\nA bug in the `active_connection_count` metric that affected a subset of customers was fixed.\nCustomers exporting the metric to an external monitoring system may observe a discontinuity\nbetween historical results and current results due to this one-time correction.\n\n### 2020-04-01\nThis release includes the following changes from the preview release:\n\n#### New `format` request attribute\nThe `/query` request now includes a `format` attribute which controls the result structuring in\nthe response body.  See the `/query` endpoint definition for more details.\n\n#### New `/available` endpoint\nThe new `/available` endpoint allows determining which metrics are available for a set of\nresources (defined by labels). This endpoint can be used to determine which subset of metrics\nare currently available for a specific resource (e.g. a Confluent Cloud Kafka cluster).\n\n#### Metric type changes\nThe `CUMULATIVE_(INT|DOUBLE)` metric type enumeration was changed to `COUNTER_(INT|DOUBLE)`.\nThis was done to better align with OpenTelemetry conventions. In tandem with this change,\nseveral metrics that were improperly classified as `GAUGE`s were re-classified as `COUNTER`s.\n\n### Metric name changes\nThe `/delta` suffix has been removed from the following metrics:\n* `io.confluent.kafka.server/received_bytes/delta`\n* `io.confluent.kafka.server/sent_bytes/delta`\n* `io.confluent.kafka.server/request_count/delta`\n\n### 2020-09-15\n\n#### Retire `/available` endpoint\nThe `/available` endpoint (which was in _Preview_ status) has been removed from the API.\nThe `/descriptors` endpoint can still be used to determine the universe of available\nmetrics for Metrics API.\n\n**The legacy metric names are deprecated and will stop functioning on 2020-07-01.**\n\n## API Lifecycle Policy\n\nThe following status labels are applicable to APIs, features, and SDK versions, based on\nthe current support status of each:\n\n* **Early Access** – May change at any time. Not recommended for production usage. Not\n  officially supported by Confluent. Intended for user feedback only. Users must be granted\n  explicit access to the API by Confluent.\n* **Preview** – Unlikely to change between Preview and General Availability. Not recommended\n  for production usage. Officially supported by Confluent for non-production usage.\n  For Closed Previews, users must be granted explicit access to the API by Confluent.\n* **Generally Available (GA)** – Will not change at short notice. Recommended for production\n  usage. Officially supported by Confluent for non-production and production usage.\n* **Deprecated** – No longer supported. Will be removed in the future at the announced date.\n  Use is discouraged and migration following the upgrade guide is recommended.\n* **Sunset** – Removed, and no longer supported or available.\n\nResources, operations, and individual fields in the\n<a href=\"./api.yaml\" target=\"_blank\">OpenAPI spec</a> will be annotated with\n`x-lifecycle-stage`, `x-deprecated-at`, and `x-sunset-at`. These annotations will appear in the\ncorresponding API Reference Documentation. An API is \"Generally Available\" unless explicitly\nmarked otherwise.\n\n## Compatibility Policy\n\nConfluent APIs are governed by\n<a href=\"https://docs.confluent.io/current/cloud/limits.html#upgrade-policy\" target=\"_blank\">\nConfluent Cloud Upgrade Policy</a> in which we will make backward incompatible changes and\ndeprecations approximately once per year, and will provide 180 days notice via email to all\nregistered Confluent Cloud users.\n\n### Backward Compatibility\n\n> *An API version is backwards-compatible if a program written against the previous version of\n> the API will continue to work the same way, without modification, against this version of the\n> API.*\n\nConfluent considers the following changes to be backwards-compatible:\n\n* Adding new API resources.\n* Adding new optional parameters to existing API requests (e.g., query string or body).\n* Adding new properties to existing API responses.\n* Changing the order of properties in existing API responses.\n* Changing the length or format of object IDs or other opaque strings.\n  * Unless otherwise documented, you can safely assume object IDs we generate will never exceed\n    255 characters, but you should be able to handle IDs of up to that length.\n    If you're using MySQL, for example, you should store IDs in a\n    `VARCHAR(255) COLLATE utf8_bin` column.\n  * This includes adding or removing fixed prefixes (such as `lkc-` on kafka cluster IDs).\n  * This includes API keys, API tokens, and similar authentication mechanisms.\n  * This includes all strings described as \"opaque\" in the docs, such as pagination cursors.\n* Omitting properties with null values from existing API responses.\n\n### Client Responsibilities\n\n* Resource and rate limits, and the default and maximum sizes of paginated data **are not**\n  considered part of the API contract and may change (possibly dynamically). It is the client's\n  responsibility to read the road signs and obey the speed limit.\n* If a property has a primitive type and the API documentation does not explicitly limit its\n  possible values, clients **must not** assume the values are constrained to a particular set\n  of possible responses.\n* If a property of an object is not explicitly declared as mandatory in the API, clients\n  **must not** assume it will be present.\n* A resource **may** be modified to return a \"redirection\" response (e.g. `301`, `307`) instead\n  of directly returning the resource. Clients **must** handle HTTP-level redirects, and respect\n  HTTP headers (e.g. `Location`).\n\n## Deprecation Policy\n\nConfluent will announce deprecations at least 180 days in advance of a breaking change\nand we will continue to maintain the deprecated APIs in their original form during this time.\n\nExceptions to this policy apply in case of critical security vulnerabilities or functional\ndefects.\n\n### Communication\n\nWhen a deprecation is announced, the details and any relevant migration\ninformation will be available on the following channels:\n\n* Publication in the [API Changelog](#section/Versioning/Changelog)\n* Lifecycle, deprecation and \"x-deprecated-at\" annotations in the\n  <a href=\"/docs/api.yaml\" target=\"_blank\">OpenAPI spec</a>\n* Announcements on the\n  <a href=\"https://www.confluent.io/blog/\" target=\"_blank\">Developer Blog</a>,\n  <a href=\"https://confluentcommunity.slack.com\" target=\"_blank\">Community Slack</a>\n  (<a href=\"https://slackpass.io/confluentcommunity\" target=\"_blank\">join!</a>),\n  <a href=\"https://groups.google.com/forum/#!forum/confluent-platform\" target=\"_blank\">\n  Google Group</a>,\n  the <a href=\"https://twitter.com/ConfluentInc\" target=\"_blank\">@ConfluentInc twitter</a>\n  account, and similar channels\n* Enterprise customers may receive information by email to their specified Confluent contact,\n  if applicable.\n\n# Object Model\nThe object model for the Metrics API is designed similarly to the\n[OpenTelemetry](https://opentelemetry.io/) standard.\n\n## Metrics\nA _metric_ is a numeric attribute of a resource, measured at a specific point in time, labeled\nwith contextual metadata gathered at the point of instrumentation.\n\nThere are two types of metrics:\n* `GAUGE`: An instantaneous measurement of a value.\n  Gauge metrics are implicitly averaged when aggregating over time.\n  > Example: `io.confluent.kafka.server/retained_bytes`\n* `COUNTER`: The count of occurrences in a _single (one minute) sampling\n  interval_ (unless otherwise stated in the metric description).\n  Counter metrics are implicitly summed when aggregating over time.\n  > Example: `io.confluent.kafka.server/received_bytes`\n\nThe list of metrics and their labels is available at [/docs/descriptors](/docs/descriptors).\n\n## Resources\nA _resource_ represents an entity against which metrics are collected.  For example, a Kafka\ncluster, a Kafka Connector, a ksqlDB application, etc.\n\nEach metric _descriptor_ is associated with one or more resource _descriptors_, representing\nthe resource types to which that metric can apply.  A metric _data point_ is associated with a\nsingle resource _instance_, identified by the resource labels on that metric data point.\n\nFor example, metrics emitted by Kafka Connect are associated to the `connector` resource type.\nData points for those metrics include resource labels identifying the specific `connector`\ninstance that emitted the metric.\n\nThe list of resource types and labels are discoverable via the `/descriptors/resources`\nendpoint.\n\n## Labels\nA _label_ is a key-value attribute associated with a metric data point.\n\nLabels can be used in queries to filter or group the results.  Labels must be prefixed when\nused in queries:\n* `metric.<label>` (for metric labels), for example `metric.topic`\n* `resource.<resource-type>.<label>` (for resource labels), for example `resource.kafka.id`.\n\nThe set of valid label keys for a metric include:\n* The label keys defined on that metric's descriptor itself\n* The label keys defined on the resource descriptor for the metric's associated resource type\n\nFor example, the `io.confluent.kafka.server/received_bytes` metric has the following labels:\n* `resource.kafka.id` - The Kafka cluster to which the metric pertains\n* `metric.topic` - The Kafka topic to which the bytes were produced\n* `metric.partition` - The partition to which the bytes were produced\n\n## Datasets\nA _dataset_ is a logical collection of metrics that can be queried together.  The `dataset` is\na required URL template parameter for every endpoint in this API.  The following datasets are\ncurrently available:\n\n<table>\n<thead>\n  <tr>\n    <th style=\"width: 250px;\">Dataset</th>\n    <th>Description</th>\n  </tr>\n</thead>\n<tbody>\n  <tr>\n    <td>\n      <code>cloud</code>\n      <p><img\n          src=\"https://img.shields.io/badge/Lifecycle%20Stage-Generally%20Available-%230074A2\"\n          alt=\"generally-available\">\n    </td>\n    <td>\n      Metrics originating from Confluent Cloud resources.\n      <p>Requests to this dataset require a resource <code>filter</code>\n         (e.g. Kafka cluster ID, Connector ID, etc.) in the query for authorization purposes.\n         The client's API key must be authorized for the resource referenced in the filter.\n    </td>\n  </tr>\n  <tr>\n    <td>\n      <code>cloud-custom</code>\n      <p><img\n          src=\"https://img.shields.io/badge/Lifecycle%20Stage-Generally%20Available-%230074A2\"\n          alt=\"generally-available\">\n    </td>\n    <td>\n      Metrics originating from custom Confluent Cloud resources (e.g. a Custom Connector).\n      <p>Requests to this dataset require a resource <code>filter</code>\n         (e.g. Custom Connector ID, etc.) in the query for authorization purposes.\n         The client's API key must be authorized for the resource referenced in the filter.\n    </td>\n  </tr>\n  <tr>\n    <td>\n      <code>USM</code>\n      <p><img\n          src=\"https://img.shields.io/badge/Lifecycle%20Stage-Generally%20Available-%230074A2\"\n          alt=\"generally-available\">\n    </td>\n    <td>\n      Metrics originating from Confluent Platform resources with Confluent Unified Stream Manager (USM) enabled.\n      <p>Requests to this dataset require a resource <code>filter</code>\n         (e.g. Kafka cluster ID, Connector ID, etc.) in the query for authorization purposes.\n         The client's API key must be authorized for the resource referenced in the filter.\n    </td>\n  </tr>\n  <tr>\n    <td>\n      <code>health-plus</code>\n      <p><img\n          src=\"https://img.shields.io/badge/Lifecycle%20Stage-Preview-%2300AFBA\"\n          alt=\"preview\">\n    </td>\n    <td>\n      Metrics originating from Confluent Platform resources.\n    </td>\n  </tr>\n</tbody>\n</table>\n\n# Client Considerations and Best Practices\n\n## Rate Limiting\nTo protect the stability of the API and keep it available to all users, Confluent employs\nmultiple safeguards. Users who send many requests in quick succession or perform too many\nconcurrent operations may be throttled or have their requested rejected with an error.\nWhen a rate limit is breached, an HTTP `429 Too Many Requests` error is returned. The\nfollowing headers are sent back to provide assistance in dealing with rate limits.\n\n| Header                  | Description                            |\n| ----------------------- | -------------------------------------- |\n| `rateLimit-limit`     | The maximum number of requests you're permitted to make per time period. |\n| `rateLimit-reset`     | The relative time in seconds until the current rate limit window resets. **Important:** This differs from Github and Twitter\\'s same-named header which uses UTC epoch seconds. We use relative time to avoid client/server time synchronization issues. |\n| `rateLimit-remaining` | The number of requests remaining in the current rate-limit window. |\n\nRate limits are enforced at multiple scopes. You get two sets of the headers above, each\nspecifying the limit of one scope.\n\n### Global Rate Limits\nA global rate limit of **300 requests per IP address, per minute** is enforced. These limits should be sufficient for most users. However, if you require increased access to these APIs, please contact [Confluent Support](https://support.confluent.io/). We may be able to increase the quota for you.\n\n### Per-endpoint Rate Limits\nAdditionally, some endpoint-specific rate limits are enforced.\n\n| Endpoint  | Rate limit |\n| --------- | ---------- |\n| `/v2/metrics/{dataset}/export` | 160 requests per resource, per hour, per principal.<br/>See the [export endpoint documentation](#tag/Version-2/paths/~1v2~1metrics~1{dataset}~1export/get) for details. |\n\n## Retries\nImplement retry logic in your client to gracefully handle transient API failures.\nThis should be done by watching for error responses and building in a retry mechanism.\nThis mechanism should follow a capped exponential backoff policy to prevent retry\namplification (\"retry storms\") and also introduce some randomness (\"jitter\") to avoid the\n[thundering herd effect](https://en.wikipedia.org/wiki/Thundering_herd_problem).\n\n## Metric Data Latency\nMetric data points are typically available for query in the API within **3 minutes** of their\norigination at the source.  This latency can vary based on network conditions and processing\noverhead.  Clients that are polling (or \"scraping\") metrics into an external monitoring system\nshould account for this latency in their polling requests.  API requests that fail to\nincorporate the latency into the query `interval` may have incomplete data in the response.\n\n## Pagination\nCursors, tokens, and corresponding pagination links may expire after a short amount of time.\nIn this case, the API will return a `400 Bad Request` error and the client will need to restart\nfrom the beginning.\n\nThe client should have no trouble pausing between rate limiting windows, but persisting cursors\nfor hours or days is not recommended.\n"
  version: ''
  title: Confluent Cloud Metrics Version 2 API
  x-api-id: 4be9bd3c-ea9b-4efe-89aa-946c36b50161
  x-audience: external-public
  x-logo:
    url: https://assets.confluent.io/m/1661ef5e4ff82d3d/
servers:
- url: https://api.telemetry.confluent.cloud
security:
- api-key: []
- confluent-sts-access-token: []
tags:
- name: Version 2
  description: "![generally-available](https://img.shields.io/badge/Lifecycle%20Stage-Generally%20Available-%230074A2)\n\nVersion 2 of the Metrics API adds the ability to query metrics for Kafka Connect, ksqlDB,\nand Schema Registry.\n\nThis capability is enabled by the introduction of a [Resource](#section/Object-Model/Resources)\nabstraction into the API object model. Resources represent the entity against which metrics\nare collected.\n\n### Migration Guide\nThe following endpoint URLs have changed in version 2:\n\n| Endpoint                | Version 1 (Sunset)           | Version 2                                |\n| ----------------------- | -------------------------------- | ---------------------------------------- |\n| Metrics discovery       | `/metrics/{dataset}/descriptors` | `/metrics/{dataset}/descriptors/metrics` |\n\nThe label prefix syntax has changed in version 2:\n\n| Label                   | Version 1 (Sunset)       | Version 2               |\n| ----------------------- | ---------------------------- | ----------------------- |\n| Resource labels *(new)* | *N/A*                        | `resource.<label>`      |\n| Kafka cluster ID        | `metric.label.cluster_id`    | `resource.kafka.id`     |\n| All other metric labels | `metric.label.<label>`       | `metric.<label>`        |\n\nThis example shows a request to `/v1/metrics/cloud/query` migrated into the new `v2` syntax\n\n#### Version 1 Request\n```json\n{\n  \"group_by\": [\n    \"metric.label.topic\"\n  ],\n  \"aggregations\": [{\n    \"metric\": \"io.confluent.kafka.server/received_bytes\",\n    \"agg\": \"SUM\"\n  }],\n  \"filter\": {\n    \"field\": \"metric.label.cluster_id\",\n    \"op\": \"EQ\",\n    \"value\": \"lkc-00000\"\n  },\n  \"granularity\": \"ALL\",\n  \"intervals\" : [\n    \"2020-01-01T00:00:00Z/PT1H\"\n  ]\n}\n```\n\n#### Version 2 Request\n```json\n{\n  \"group_by\": [\n    \"metric.topic\"\n  ],\n  \"aggregations\": [{\n    \"metric\": \"io.confluent.kafka.server/received_bytes\",\n    \"agg\": \"SUM\"\n  }],\n  \"filter\": {\n    \"field\": \"resource.kafka.id\",\n    \"op\": \"EQ\",\n    \"value\": \"lkc-00000\"\n  },\n  \"granularity\": \"ALL\",\n  \"intervals\" : [\n    \"2020-01-01T00:00:00Z/PT1H\"\n  ]\n}\n```\n"
paths:
  /v2/metrics/{dataset}/descriptors/metrics:
    get:
      summary: List metric descriptors
      tags:
      - Version 2
      description: 'Lists all the metric descriptors for a dataset.


        A metric descriptor represents metadata for a metric, including its data type and labels.

        This metadata is provided programmatically to enable clients to dynamically adjust as new

        metrics are added to the dataset, rather than hardcoding metric names in client code.

        '
      parameters:
      - name: dataset
        in: path
        required: true
        description: The [dataset](#section/Object-Model/Datasets) to list metric descriptors for.
        schema:
          $ref: '#/components/schemas/Dataset'
      - name: page_size
        description: The maximum number of results to return. The page size is an integer in the range from 1 through 1000.
        in: query
        required: false
        schema:
          type: integer
          minimum: 1
          maximum: 1000
          default: 100
      - name: page_token
        description: The next page token. The token is returned by the previous request as part of `meta.pagination`.
        in: query
        required: false
        schema:
          $ref: '#/components/schemas/PageToken'
      - name: resource_type
        description: The type of the resource to list metric descriptors for.
        in: query
        required: false
        schema:
          $ref: '#/components/schemas/ResourceType'
      responses:
        '200':
          description: Successful response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ListMetricDescriptorsResponse'
              examples:
                listResponse:
                  value:
                    data:
                    - description: The delta count of bytes received from the network. Each sample is the number of bytes received since the previous data sample. The count is sampled every 60 seconds.
                      labels:
                      - description: The name of the Kafka topic.
                        key: topic
                        exportable: true
                      name: io.confluent.kafka.server/received_bytes
                      type: COUNTER_INT64
                      exportable: true
                      unit: By
                      lifecycle_stage: GENERAL_AVAILABILITY
                      resources:
                      - kafka
                    - description: The delta count of bytes sent over the network. Each sample is the number of bytes sent since the previous data point. The count is sampled every 60 seconds.
                      labels:
                      - description: The name of the Kafka topic.
                        key: topic
                        exportable: true
                      name: io.confluent.kafka.server/sent_bytes
                      type: COUNTER_INT64
                      exportable: true
                      unit: By
                      lifecycle_stage: GENERAL_AVAILABILITY
                      resources:
                      - kafka
                    links: null
                    meta:
                      pagination:
                        page_size: 3
                        total_size: 3
        '429':
          $ref: '#/components/responses/RateLimitError'
        default:
          description: Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
  /v2/metrics/{dataset}/descriptors/resources:
    get:
      tags:
      - Version 2
      summary: List resource descriptors
      description: 'Lists all the resource descriptors for a dataset.

        '
      parameters:
      - name: dataset
        in: path
        required: true
        description: The [dataset](#section/Object-Model/Datasets) to list resource descriptors for.
        schema:
          $ref: '#/components/schemas/Dataset'
      - name: page_size
        description: The maximum number of results to return. The page size is an integer in the range from 1 through 1000.
        in: query
        required: false
        schema:
          type: integer
          minimum: 1
          maximum: 1000
          default: 100
      - name: page_token
        description: The next page token. The token is returned by the previous request as part of `meta.pagination`.
        in: query
        required: false
        schema:
          $ref: '#/components/schemas/PageToken'
      responses:
        '200':
          description: Successful response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ListResourceDescriptorsResponse'
        '429':
          $ref: '#/components/responses/RateLimitError'
        default:
          description: Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
  /v2/metrics/{dataset}/query:
    post:
      summary: Query metric values
      tags:
      - Version 2
      description: 'Query for metric values in a dataset.

        '
      parameters:
      - name: dataset
        in: path
        required: true
        description: The [dataset](#section/Object-Model/Datasets) to query.
        schema:
          $ref: '#/components/schemas/Dataset'
      - name: page_token
        description: The next page token. The token is returned by the previous request as part of `meta.pagination`. Pagination is only supported for requests containing a `group_by` element. The request body, including `intervals`, must be identical across paginated requests. Using `now` in `intervals` invalidates the token because it resolves to a different time on each request; use absolute timestamps instead. Pagination is supported only for time-based granularities; it is not available when `granularity` is `ALL`.
        in: query
        required: false
        schem

# --- truncated at 32 KB (89 KB total) ---
# Full source: https://raw.githubusercontent.com/api-evangelist/confluent/refs/heads/main/openapi/confluent-version-2-api-openapi.yml