FAQ for Confluent Cloud Metrics¶
Find answers to frequently asked questions about Confluent Metrics.
Can the Metrics API be used to reconcile my bill?¶
The Metrics API is intended to provide information for the purposes of monitoring, troubleshooting, and capacity planning. It is not intended as an audit system for reconciling bills as the metrics may not include request overhead for the Kafka protocol. For more details, see the billing documentation.
Why am I seeing empty data sets for topics that exist on queries other than for retained_bytes
?¶
If there are only values of 0.0 in the time range queried, than the API will return an empty set. When there is non-zero data within the time range, time slices with values of 0.0 are returned.
Why didn’t retained_bytes
decrease after I changed the retention policy for my topic?¶
The value of retained_bytes
is calculated as the maximum over the interval for each data point returned.
If data has been deleted during the current interval, you will not see the effect until the next time range window begins.
For example, if you produced four GB of data per day over the last 30 days and queried for retained_bytes
over
the last three days with a one day interval, the query would return values of 112 GB, 116 GB, 120 GB as a time series. If
you then deleted all data in the topic and stopped producing data, the query would return the same values until the
next day. When queried at the start of the next day, the same query would return 116 GB, 120 GB, 0 GB.
What are the supported granularity levels?¶
Data is stored at a granularity of one minute. However, the allowed granularity for a query is restricted by the size of the query’s interval.
For the currently supported granularity levels and query restrictions, see the API Reference.
What is the retention time of metrics in the Metrics API?¶
Metrics are retained for seven days.
Do not confuse retention time with the granularity levels and query intervals mentioned in the API Reference. Confluent uses granularity and intervals to validate requests. Retention time refers to the length of time Confluent stores data. The largest interval Confluent supports is seven days. Making a request with an interval greater than seven days is useless because Confluent doesn’t retain data past seven days.
How do I monitor consumer lag?¶
- Query for the average consumer lag by using the Metrics API.
- Also, there are multiple other ways to monitor Consumer lag including the client metrics, UI, CLI, and Admin API. These methods are all available when using Confluent Cloud.
How do I know if a given metric is in preview or generally available (GA)?¶
You can find each metric’s lifecycle stage (preview
, generally available
, etc.) in the
response from the /descriptors/metrics
endpoint. While a metric is in preview
stage, you may find
breaking changes to labels without an API version change. This type iteration is necessary for Confluent to
stabilize changes and ensure the metric is suitable for most use cases.
What should I do if a query to Metrics API returns a timeout response (HTTP error code 504)?¶
If queries are exceeding the timeout (maximum query time is 60s) you may consider one or more of the following approaches:
- Reduce the time interval.
- Reduce the granularity of data returned.
- Break up the query on the client side to return fewer data points. For example, you can query for specific topics instead of all topics at once.
These approaches are especially important to when querying for partition-level data over days-long intervals.
Why are my Confluent Cloud metrics displaying only 1hr/6hrs/24hrs worth of data?¶
This is a known limitation that occurs in some clusters with a partition count of more than 2,000. Work is ongoing to resolve this issue, but there is no fix at this time.
What should I do if a query returns a 5xx response code?¶
Confluent recommends you retry these type of responses. Usually, this is an indication of a transient server-side issue. You should design your client implementations for querying the Metrics API to be resilient to this type of response for minutes-long periods.
How do I collect metrics for Confluent Cloud resources using Cloud Console?¶
From the Administration menu, select Metrics.
From Explore available metrics, select a Metric and a Resource. If there is data available for the metric you selected, the chart displays the data.
You can select a new time interval to meet your needs.
To copy a cURL template of the query used to display the selected data, select Copy cURL template. A template of the cURL command is added to your clipboard. Paste the template into a command prompt (Windows) or terminal (Mac, Linux). Edit the template to add an API key and secret to authenticate the request.
Does Cloud Console make use of all the metrics available through the Metrics API?¶
Cloud Console uses the Metrics API to provide metrics. However, if you have a high number of resources, Cloud Console may not be able to query all metrics. For example, say you have 1,000 or more topics or consumer groups, Cloud Console may not be able to query metrics for the topics list or consumer lag pages. In that situation, you should use the Metrics API to get information unavailable through Cloud Console.
How do I access notifications with Cloud Console?¶
Access the Manage notifications page by clicking the Alert bell icon in the upper right of the console. To learn more about notifications, see Notifications for Confluent Cloud.
How do I monitor cluster activity with Cloud Console?¶
You can monitor cluster activity and usage from the Clusters page within each of your environments. To view the page, sign in to Confluent Cloud, choose an environment, and the Clusters page displays.