# Metric Output and Coverage

## Goal

TiDB-X support is not only about making queries succeed.
The exported metric shape also has to follow TiDB-X product semantics.

## Product Semantics

For Premium, Essential, and Starter:

- pod concepts such as `tidb-1` and `tidb-2` should not be exposed to users
- `cluster_id` becomes `instance_id`
- `cluster_name` becomes `instance_name`
- project-level concepts are removed from exported metrics
- node-level labels such as `instance` and `component` are removed from user-facing TiDB-X output

Dedicated keeps the old output model.

## Coverage in Scope

### Supported for TiDB-X Launch

- DB performance metrics
- CDC metrics
- storage metrics for shared TiKV / TiFlash series
- both Prometheus and OTel export paths

Current logical counts are:

- DB metrics: 10
- CDC metrics: 4 in OTel, 5 in Prometheus
- storage metrics: 2

### Out of Scope

- DM
- Dedicated-only node and infrastructure metrics for TiDB-X

## Plan Differences

### Premium

- exported as instance-level metrics
- queries currently match by `tidb_cluster_id`

### Essential / Starter

- exported as instance-level metrics
- DB queries use `cluster_id`
- shared-series CDC and storage queries use `keyspace_id`

### Dedicated

- full legacy label model remains unchanged

## Dedicated-Only Areas

These are intentionally not part of TiDB-X output semantics:

- node and infra metrics
- RU metrics
- DM metrics
- other Dedicated-only topology-dependent series

## What to Verify in Validation

- TiDB-X output contains `instance_id` and `instance_name`
- TiDB-X output does not contain `project_id`, `project_name`, `instance`, or `component`
- Premium / Essential / Starter all export through both supported pipeline types
- Dedicated output remains identical to the historical baseline

## Related Docs

- `03-datasource-routing-and-query-semantics.md`
- `05-validation-and-rollout.md`
