---
title: Telegraf Documentation
description: Telegraf plugin for transforming metrics using Tag Limit
url: https://docs.influxdata.com/telegraf/v1/processor-plugins/tag_limit/
estimated_tokens: 756
product: Telegraf
version: v1
---

-   Telegraf v1.12.0+

# Tag Limit Processor Plugin

This plugin ensures that only a certain number of tags are preserved for any given metric, and to choose the tags to preserve when the number of tags appended by the data source is over the limit.

This can be useful when dealing with output systems (e.g. Stackdriver) that impose hard limits on the number of tags/labels per metric or where high levels of cardinality are computationally and/or financially expensive.

**Introduced in:** Telegraf v1.12.0 **Tags:** filtering **OS support:** all

## Global configuration options

Plugins support additional global and plugin configuration settings for tasks such as modifying metrics, tags, and fields, creating aliases, and configuring plugin ordering. See [CONFIGURATION.md](/telegraf/v1/configuration/#plugins) for more details.

## Configuration

```toml
# Restricts the number of tags that can pass through this filter and chooses which tags to preserve when over the limit.
[[processors.tag_limit]]
  ## Maximum number of tags to preserve
  limit = 3

  ## List of tags to preferentially preserve
  keep = ["environment", "region"]
```

## Example

```diff
+ throughput month=Jun,environment=qa,region=us-east1,lower=10i,upper=1000i,mean=500i 1560540094000000000
+ throughput environment=qa,region=us-east1,lower=10i 1560540094000000000

```

#### Related

-   [Configure plugins](/telegraf/v1/configure_plugins/)
-   [Tag Limit Plugin Source](https://github.com/influxdata/telegraf/tree/v1.38.4/plugins/processors/tag_limit/README.md)
