cockroachdb / cockroachdb/cockroach
tenantcostserver: metrics should be exported with tenant names
- Dominant language
- Go
- Stars
- 32.5k
- Forks
- 4.1k
- PR merge metrics
- PR metrics pending
Description
Currently, the tenant RU metrics in KV (e.g., tenant_consumption_external_io_egress_bytes, tenant_consumption_cross_region_network_ru) 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 tenant_consumption_cross_region_network_ru Total number of RUs charged for cross-region network traffic
# TYPE tenant_consumption_cross_region_network_ru counter
tenant_consumption_cross_region_network_ru{node_id="1"} 0
tenant_consumption_cross_region_network_ru{node_id="1",tenant_id="134"} 1.6404048228014728e+08
tenant_consumption_cross_region_network_ru{node_id="1",tenant_id="135"} 1.056147838068681e+08
tenant_consumption_cross_region_network_ru{node_id="1",tenant_id="136"} 1.0207882169642285e+08
tenant_consumption_cross_region_network_ru{node_id="1",tenant_id="137"} 1.0925697613772346e+08
tenant_consumption_cross_region_network_ru{node_id="1",tenant_id="138"} 2.5925507410968877e+07
```
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-42558
Contributor guide
Assessment
This issue has not been assessed yet.