Description
The API request Rate limits are 25 Write requests per second or 75 Read requests per second, across all API keys pointing to a particular LSRC. If the number of requests go beyond the above mentioned limits, you may see the requests being delayed, throttled or rejected.
This article outlines the Metrics API commands, to monitor the read and write requests for a Confluent Cloud Schema Registry cluster.
Applies To
Confluent Cloud
Schema Registry
Resolution
To monitor the delta count of schema related read and write requests in one minute, by using the finest granularity of PT1M, you can query the Metrics API similar to these commands.
For Write requests: (also include the count from DELETE method for total write requests)
curl -d '{
"aggregations": [
{
"metric": "io.confluent.kafka.schema_registry/schema_operations_count",
"agg": "SUM"
}
],
"filter": {
"filters": [
{
"field": "resource.schema_registry.id",
"op": "EQ",
"value": "lsrc-"
},
{
"field": "metric.method",
"op": "EQ",
"value": "CREATE"
}
],
"op": "AND"
},
"granularity": "PT1M",
"intervals": [
"now-5m/now"
],
"group_by": [
"resource.schema_registry.id"
]
} ' --header 'content-type: application/json' \
"https://api.telemetry.confluent.cloud/v2/metrics/cloud/query" \
-u key:secret | jq
For Read requests:
curl -d '{
"aggregations": [
{
"metric": "io.confluent.kafka.schema_registry/schema_operations_count",
"agg": "SUM"
}
],
"filter": {
"filters": [
{
"field": "resource.schema_registry.id",
"op": "EQ",
"value": "lsrc-"
},
{
"field": "metric.method",
"op": "EQ",
"value": "READ"
}
],
"op": "AND"
},
"granularity": "PT1M",
"intervals": [
"now-5m/now"
],
"group_by": [
"resource.schema_registry.id"
]
} ' --header 'content-type: application/json' \
"https://api.telemetry.confluent.cloud/v2/metrics/cloud/query" \
-u key:secret | jqFrom the above queries, please replace lsrc- with the complete lsrc id details and choose the intervals accordingly.
Also note that the Read and Write rate limits per second to Stream Catalog are also 75 reads/sec and 25 writes/sec respectively. But these are separate from that of Schema Registry rate limits mentioned here.
That is, for example , you may get Too Many Requests - 429s error while creating business metadata and tags, when those create requests to Stream Catalog are greater than 25 writes/sec.
In case you get 429s while creating business metadata / tags in Terraform, then you can use this max retries config :
provider "confluent" {
..
max_retries = 8 # defaults to 4
}