# Group by Attributes

| Metrics | Logs | Traces | Bindplane Collector |
| ------- | ---- | ------ | ------------------- |
| ✓       | ✓    | ✓      | `v1.0.0+`           |

### Description

The Group by Attributes Processor groups telemetry with shared attribute values into the same resource.

### Use

1. "Promote" attributes so telemetry with those attributes gets grouped under a *resource* of that value.
2. [Compact](https://github.com/open-telemetry/opentelemetry-collector-contrib/tree/main/processor/groupbyattrsprocessor#compaction) telemetry data that shares a resource after batching.

### Configuration

<table><thead><tr><th width="156.08984375">Field</th><th>Description</th></tr></thead><tbody><tr><td>Telemetry Types</td><td>The types of telemetry to apply the processor to.</td></tr><tr><td>Attribute Keys</td><td>The attribute keys to group by and move to the resource. When no keys are specified, resources with the same attributes are compacted into the one resource.</td></tr></tbody></table>

### Example Configurations

#### 1. Promote an attribute

An example of promoting the `user` attribute on logs:

<figure><img src="https://1405008107-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FgmiOMzBfoNFwmKJFHMcJ%2Fuploads%2Fgit-blob-274e85190a5d476030364b68ce1eaf19fef91582%2Fintegrations-processors-group-by-attributes-image-1.png?alt=media" alt="Bindplane docs - Group by Attributes - image 1"><figcaption></figcaption></figure>

#### Before processor:

<figure><img src="https://1405008107-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FgmiOMzBfoNFwmKJFHMcJ%2Fuploads%2Fgit-blob-37a8ab6fed182c282b965e87a266b938eced6210%2Fintegrations-processors-group-by-attributes-image-2.png?alt=media" alt="Bindplane docs - Group by Attributes - image 2"><figcaption></figcaption></figure>

#### After:

<figure><img src="https://1405008107-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FgmiOMzBfoNFwmKJFHMcJ%2Fuploads%2Fgit-blob-46a8690434529820be117ece85b798c0bb21e71f%2Fintegrations-processors-group-by-attributes-image-3.png?alt=media" alt="Bindplane docs - Group by Attributes - image 3"><figcaption></figcaption></figure>

#### 2. Compact telemetry with the same resource

By default, the processor will [compact](https://github.com/open-telemetry/opentelemetry-collector-contrib/tree/main/processor/groupbyattrsprocessor#compaction) telemetry that shares the same resource. Using this processor after the batch processor can reduce the amount of data sent to some destinations.

<figure><img src="https://1405008107-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FgmiOMzBfoNFwmKJFHMcJ%2Fuploads%2Fgit-blob-1d80235710d190e293f85352ffaaf21d5a6f135b%2Fintegrations-processors-group-by-attributes-image-4.png?alt=media" alt="Bindplane docs - Group by Attributes - image 4"><figcaption></figcaption></figure>


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.bindplane.com/integrations/processors/group-by-attributes.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
