# <a id="bitdrift.public.unary.charts.v1.LimitStrategy"></a>LimitStrategy

**Source definition:** [`src/bitdrift/public/unary/charts/v1/chart_id.proto#L81-L144`](<https://github.com/bitdriftlabs/api/blob/main/src/bitdrift/public/unary/charts/v1/chart_id.proto#L81-L144>)

<section class="proto-fields-table" markdown>
| Field | Type | Description |
|---|---|---|
| top_k_limit | <span class="proto-type proto-type-message">[<i class="proto-type-part">bitdrift</i><i class="proto-type-dot">.</i><i class="proto-type-part">public</i><i class="proto-type-dot">.</i><i class="proto-type-part">unary</i><i class="proto-type-dot">.</i><i class="proto-type-part">charts</i><i class="proto-type-dot">.</i><i class="proto-type-part">v1</i><i class="proto-type-dot">.</i><i class="proto-type-part">LimitStrategy</i><i class="proto-type-dot">.</i><i class="proto-type-part">TopKLimit</i>](#bitdrift.public.unary.charts.v1.LimitStrategy.TopKLimit "bitdrift.public.unary.charts.v1.LimitStrategy.TopKLimit")</span><span class="proto-field-annotation">only one of <em>top_k_limit</em>, or <em>identifier_match</em> can be set</span> | Select the top K groups per time series based on the aggregated value for the chart metric. This is the most common limit strategy and is used when there are too many groups to display in the chart and we want to show the most important ones. |
| identifier_match | <span class="proto-type proto-type-message">[<i class="proto-type-part">bitdrift</i><i class="proto-type-dot">.</i><i class="proto-type-part">public</i><i class="proto-type-dot">.</i><i class="proto-type-part">unary</i><i class="proto-type-dot">.</i><i class="proto-type-part">charts</i><i class="proto-type-dot">.</i><i class="proto-type-part">v1</i><i class="proto-type-dot">.</i><i class="proto-type-part">LimitStrategy</i><i class="proto-type-dot">.</i><i class="proto-type-part">IdentifierMatch</i>](#bitdrift.public.unary.charts.v1.LimitStrategy.IdentifierMatch "bitdrift.public.unary.charts.v1.LimitStrategy.IdentifierMatch")</span><span class="proto-field-annotation">only one of <em>identifier_match</em>, or <em>top_k_limit</em> can be set</span> | Select specific groups based on their dimension values. This is used to target particular groups that we want to display in the chart regardless of their aggregated value. |
| sort_order | <span class="proto-type proto-type-enum">[<i class="proto-type-part">bitdrift</i><i class="proto-type-dot">.</i><i class="proto-type-part">public</i><i class="proto-type-dot">.</i><i class="proto-type-part">unary</i><i class="proto-type-dot">.</i><i class="proto-type-part">charts</i><i class="proto-type-dot">.</i><i class="proto-type-part">v1</i><i class="proto-type-dot">.</i><i class="proto-type-part">SortOrder</i>](bitdrift_public_unary_charts_v1_SortOrder.md "bitdrift.public.unary.charts.v1.SortOrder")</span><br><em class="proto-field-annotation">must be a defined enum value</em> | The sort order to use when applying the limit strategy. By default the output returns the top K  of maximum values, but can be switched to return the top K of minimum values (bottom K). |
| exclusions | <span class="proto-type proto-type-message">[<i class="proto-type-part">bitdrift</i><i class="proto-type-dot">.</i><i class="proto-type-part">public</i><i class="proto-type-dot">.</i><i class="proto-type-part">unary</i><i class="proto-type-dot">.</i><i class="proto-type-part">charts</i><i class="proto-type-dot">.</i><i class="proto-type-part">v1</i><i class="proto-type-dot">.</i><i class="proto-type-part">LimitStrategy</i><i class="proto-type-dot">.</i><i class="proto-type-part">IdentifierMatch</i>](#bitdrift.public.unary.charts.v1.LimitStrategy.IdentifierMatch "bitdrift.public.unary.charts.v1.LimitStrategy.IdentifierMatch")</span> | Optional exclusions to apply when limiting. This is used to exclude specific dimensions from the top K results |

</section>
<p class="h4">Example</p>
```json
{
  "exclusions": {
    "dimension_identifiers": [
      {
        "id": "time_series_id_opaque_example",
        "labels": [
          {
            "name": "name",
            "value": "value"
          }
        ]
      }
    ],
    "return_other": false
  },
  "sort_order": "MAX",
  "top_k_limit": {
    "top_k": 5
  }
}
```

# <a id="bitdrift.public.unary.charts.v1.LimitStrategy.TopKLimit"></a>LimitStrategy.TopKLimit

**Source definition:** [`src/bitdrift/public/unary/charts/v1/chart_id.proto#L82-L85`](<https://github.com/bitdriftlabs/api/blob/main/src/bitdrift/public/unary/charts/v1/chart_id.proto#L82-L85>)

<section class="proto-fields-table" markdown>
| Field | Type | Description |
|---|---|---|
| top_k | <span class="proto-type proto-type-primitive">uint64</span><br><em class="proto-field-annotation">greater than 0</em> | The number of time series to return per chart dimension. |

</section>
<p class="h4">Example</p>
```json
{
  "top_k": 5
}
```

# <a id="bitdrift.public.unary.charts.v1.LimitStrategy.IdentifierMatch"></a>LimitStrategy.IdentifierMatch

**Source definition:** [`src/bitdrift/public/unary/charts/v1/chart_id.proto#L91-L128`](<https://github.com/bitdriftlabs/api/blob/main/src/bitdrift/public/unary/charts/v1/chart_id.proto#L91-L128>)

Used to select specific time series from a chart instead of relying on a top-K algorithm.

 This specifies the list of dimension values to include in the results. Only time series that match one of the sent
 dimension value combinations will be included in the results.

<section class="proto-fields-table" markdown>
| Field | Type | Description |
|---|---|---|
| dimension_identifiers | <span class="proto-type proto-type-message">array of [<i class="proto-type-part">bitdrift</i><i class="proto-type-dot">.</i><i class="proto-type-part">public</i><i class="proto-type-dot">.</i><i class="proto-type-part">unary</i><i class="proto-type-dot">.</i><i class="proto-type-part">charts</i><i class="proto-type-dot">.</i><i class="proto-type-part">v1</i><i class="proto-type-dot">.</i><i class="proto-type-part">LimitStrategy</i><i class="proto-type-dot">.</i><i class="proto-type-part">IdentifierMatch</i><i class="proto-type-dot">.</i><i class="proto-type-part">DimensionIdentifier</i>](#bitdrift.public.unary.charts.v1.LimitStrategy.IdentifierMatch.DimensionIdentifier "bitdrift.public.unary.charts.v1.LimitStrategy.IdentifierMatch.DimensionIdentifier")</span><br><em class="proto-field-annotation">between 1 and 100 items</em> | Selects specific grouped results from a chart response.   Callers send one `DimensionIdentifier` for each grouped result to include. Callers construct  each entry from a `GetChartsData` result by copying the returned `TimeSeries.id` and its  full `labels` set. For a single group-by, `labels` contains one entry. For a multi-group-by,  `labels` must contain one entry per group key in the same order as the chart definition. |
| return_other | <span class="proto-type proto-type-primitive">bool</span> | If true, the rest of the dimensions will be returned as "other". This does not currently  work for histograms. |

</section>
<p class="h4">Example</p>
```json
{
  "dimension_identifiers": [
    {
      "id": "time_series_id_opaque_example",
      "labels": [
        {
          "name": "name",
          "value": "value"
        }
      ]
    }
  ],
  "return_other": false
}
```

# <a id="bitdrift.public.unary.charts.v1.LimitStrategy.IdentifierMatch.DimensionIdentifier"></a>LimitStrategy.IdentifierMatch.DimensionIdentifier

**Source definition:** [`src/bitdrift/public/unary/charts/v1/chart_id.proto#L92-L112`](<https://github.com/bitdriftlabs/api/blob/main/src/bitdrift/public/unary/charts/v1/chart_id.proto#L92-L112>)

<section class="proto-fields-table" markdown>
| Field | Type | Description |
|---|---|---|
| id | <span class="proto-type proto-type-primitive">string</span><br><em class="proto-field-annotation">between 1 and 255 chars</em> | The `TimeSeries.id` of the grouped result to include.   Use the `id` returned by `GetChartsData` together with the matching `labels`. This value  identifies the backing time-series query and may be shared by multiple grouped results. |
| labels | <span class="proto-type proto-type-message">array of [<i class="proto-type-part">bitdrift</i><i class="proto-type-dot">.</i><i class="proto-type-part">public</i><i class="proto-type-dot">.</i><i class="proto-type-part">shared</i><i class="proto-type-dot">.</i><i class="proto-type-part">workflows</i><i class="proto-type-dot">.</i><i class="proto-type-part">v1</i><i class="proto-type-dot">.</i><i class="proto-type-part">LabelPair</i>](bitdrift_public_shared_workflows_v1_LabelPair.md "bitdrift.public.shared.workflows.v1.LabelPair")</span><br><em class="proto-field-annotation">up to 10 items</em> | The label values for the grouped result.   These labels must match the selected grouped result exactly and are evaluated together with  `id`. Labels disambiguate grouped results that share the same `TimeSeries.id`. |

</section>
<p class="h4">Example</p>
```json
{
  "id": "time_series_id_opaque_example",
  "labels": [
    {
      "name": "name",
      "value": "value"
    }
  ]
}
```

