cockroachdb / cockroachdb/cockroach

kvserver: storage metrics should export tenant names

Open
#131,476 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 storage metrics in kvserver (e.g., livebytes, totalbytes) 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 livebytes Number of bytes of live data (keys plus values)
# TYPE livebytes gauge
livebytes{store="1",node_id="1"} 9.0240844084e+10
livebytes{store="1",node_id="1",tenant_id="107"} 5.231825e+06
livebytes{store="1",node_id="1",tenant_id="110"} 1.185452e+06
livebytes{store="1",node_id="1",tenant_id="12"} 356534
```

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-42557

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.