cockroachdb / cockroachdb/cockroach

kvserver: tenantrate metrics should be exported with tenant names

Open
#131,479 0 comments 0 reactions 0 assignees View on GitHub
C-enhancement
Dominant language
Go
Stars
32.5k
Forks
4.1k
PR merge metrics
PR metrics pending

Description

Currently, the tenantrate metrics in KV (e.g., kv_tenant_rate_limit_write_requests_admitted) are exported with the `tenant_id` label. However, tenant IDs are meant to be an internal implementation detail. We should consider exporting these metrics with the tenant name label as well. Since CockroachDB Cloud relies on the `tenant_id` label, we could either include an additional tenant label automatically or control this behavior with a feature flag.

```
# HELP kv_tenant_rate_limit_write_requests_admitted Number of write requests admitted by the rate limiter
# TYPE kv_tenant_rate_limit_write_requests_admitted counter
kv_tenant_rate_limit_write_requests_admitted{store="1",node_id="1"} 1.677558e+06
kv_tenant_rate_limit_write_requests_admitted{store="1",node_id="1",tenant_id="107"} 0
kv_tenant_rate_limit_write_requests_admitted{store="1",node_id="1",tenant_id="110"} 0
kv_tenant_rate_limit_write_requests_admitted{store="1",node_id="1",tenant_id="12"} 0
```

It's worth noting that many metrics on UA clusters already use the `tenant` label. For example:

```
# TYPE distsender_rpc_err_transactionpusherrtype counter
distsender_rpc_err_transactionpusherrtype{node_id="3",tenant="system"} 4
distsender_rpc_err_transactionpusherrtype{node_id="3",tenant="demoapp"} 0
```

This ticket aims to resolve these inconsistencies in metric exporting and support the transition to tenant names in CockroachDB Cloud.

Jira issue: CRDB-42560

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.