> ## Documentation Index
> Fetch the complete documentation index at: https://docs.usetero.com/llms.txt
> Use this file to discover all available pages before exploring further.

# High cardinality tags

> Metric tags with unbounded values that create many time series

A high-cardinality tag is a metric label or tag whose values can grow without a small fixed set. Common examples include `user_id`, `request_id`, `session_id`, `trace_id`, `ip_address`, full URLs, timestamps, and raw error messages.

Each unique tag value creates a separate time series for the metric. A `user_id` tag on a latency metric creates one time series per user for each metric and dimension combination.

## Signals

| Signal | Description |
| - | - |
| Unbounded value set | The tag can contain thousands or millions of distinct values. |
| Per-request or per-user values | The tag contains identifiers such as users, sessions, requests, traces, or IP addresses. |
| Sparse series | Many generated time series have little data per series. |
| Limited query value | The tag is not used in dashboards, alerts, or common queries. |

## Example

> [tab] Before
>
> ```
> http_request_duration_seconds{service="api", endpoint="/users", user_id="usr_abc123"} 0.045
> http_request_duration_seconds{service="api", endpoint="/users", user_id="usr_def456"} 0.052
> http_request_duration_seconds{service="api", endpoint="/users", user_id="usr_ghi789"} 0.038
> ```

> [tab] After
>
> ```
> http_request_duration_seconds{service="api", endpoint="/users"} 0.045
> ```

```yaml theme={null}
id: remove-user-id-tag
name: Remove user_id tag from metrics
description: Drop high-cardinality user_id tag. Creates millions of sparse time series.
metric:
  match:
    - tag: user_id
      exists: true
  transform:
    remove_tags:
      - user_id
```

## Recommended enforcement

> [card] [Enforce at edge](https://docs.usetero.com/policies/enforcement/edge.md)
>
> Strip the tag before metrics reach your provider.

> [card] [Open PRs](https://docs.usetero.com/policies/enforcement/open-prs.md)
>
> Remove the tag from instrumentation code.

The durable remediation is removing the tag from instrumentation. Edge enforcement can remove the tag before metrics reach the provider when you can't change instrumentation right away.

## Detection notes

For accounts with metric policy context, Tero analyzes tag cardinality across metrics. It flags tags with thousands or more unique values.

Tero can also check whether these tags are used in queries or dashboards. A tag with many unique values and no query usage is a candidate for removal.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.