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

# Group by Attributes

<Badge className="hny-badge-enterprise-addon" stroke>Ent+</Badge>

<Note>
  This feature is available as an add-on for the [Honeycomb Enterprise plan](https://www.honeycomb.io/pricing/).
  Please contact your Honeycomb account team for details.
</Note>

| Metrics | Logs | Traces | Telemetry Pipeline Agent |
| :------ | :--- | :----- | :----------------------- |
| ✓       | ✓    | ✓      | `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

| Field           | Description                                                                                                                                                  |
| :-------------- | :----------------------------------------------------------------------------------------------------------------------------------------------------------- |
| Telemetry Types | The types of telemetry to apply the processor to.                                                                                                            |
| Attribute Keys  | 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. |

## Example Configurations

### 1. Promote an attribute

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

<img src="https://mintcdn.com/honeycomb/ibXJI2unoLZRp0G4/_assets/images/htp/xnapper-group-by-attr-processor-1.png?fit=max&auto=format&n=ibXJI2unoLZRp0G4&q=85&s=625d66c25eaed94fa1866e510ad1b1b5" alt="Honeycomb Docs - Group by Attributes - image 1" width="1830" height="1002" data-path="_assets/images/htp/xnapper-group-by-attr-processor-1.png" />

### Before processor

<img src="https://mintcdn.com/honeycomb/ibXJI2unoLZRp0G4/_assets/images/htp/xnapper-group-by-attr-processor-2.png?fit=max&auto=format&n=ibXJI2unoLZRp0G4&q=85&s=1e9aab18814de9cfc058bf10763e81c8" alt="Honeycomb Docs - Group by Attributes - image 2" width="1300" height="1982" data-path="_assets/images/htp/xnapper-group-by-attr-processor-2.png" />

### After

<img src="https://mintcdn.com/honeycomb/ibXJI2unoLZRp0G4/_assets/images/htp/xnapper-group-by-attr-processor-3.png?fit=max&auto=format&n=ibXJI2unoLZRp0G4&q=85&s=9b5f37777f80a3feff368f85ba971439" alt="Honeycomb Docs - Group by Attributes - image 3" width="970" height="1236" data-path="_assets/images/htp/xnapper-group-by-attr-processor-3.png" />

### 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.

<img src="https://mintcdn.com/honeycomb/uwL4yrCwi_pk0JPC/_assets/images/htp/group-by-attributes-4.png?fit=max&auto=format&n=uwL4yrCwi_pk0JPC&q=85&s=b9f7e2ac977ebab6d3ce599bc28cd1cc" alt="Honeycomb Docs - Group by Attributes - image 4" width="950" height="324" data-path="_assets/images/htp/group-by-attributes-4.png" />
