> For the complete documentation index, see [llms.txt](https://docs.perfectscale.io/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.perfectscale.io/2.0-self-hosted-or-perfectscale-documentation/customize-workflow/ephemeral-pods-grouping.md).

# Ephemeral Pods Grouping

The PerfectScale grouping configuration is a powerful tool that enables the aggregation of redundant workloads exhibiting similar patterns. By preventing overload through batches of identical information, it enables you to focus on what matters, thereby streamlining analysis processes.

Custom grouping is a rule that aggregates multiple workloads into a single entity (for example, all GitLab runners are aggregated into a single entity—the GitLab workload), merging their data (resource usage, limits, requests, etc.).&#x20;

This feature is especially convenient when using Spark, GitLab, Airflow or any other operators that produce short-lived, small workloads that often reflect just a single pod in the cluster, or when automating the ungrouped workloads.

## Grouping by labels

To group the workloads, two predefined labels should be added to this workload:

| Key                                             | Value                | Description                      |
| ----------------------------------------------- | -------------------- | -------------------------------- |
| perfectscale.io/workload-grouping-workload-name | custom-workload-name | Specifies a target workload name |
| perfectscale.io/workload-grouping-workload-type | custom-workload-type | Specifies a target workload type |

This grouping approach is specifically helpful for **automating dynamic, short-lived workloads**.&#x20;

{% hint style="info" %}
Labels `perfectscale.io/workload-grouping-workload-name` and `perfectscale.io/workload-grouping-workload-type` are required to configure automation for ephemeral workloads. After applying the labels, a new workload will appear in PerfectScale. However, automation will only reduce resources after sufficient data has been collected.
{% endhint %}

To ensure PerfectScale considers all revisions, including those not made by Automation, and to drive better results, you can optionally specify the following labels:

<table><thead><tr><th>Key</th><th width="154">Value</th><th>Description</th></tr></thead><tbody><tr><td>perfectscale.io/workload-grouping-honor-spec</td><td>false</td><td>Allows PerfectScale to consider the resource changes in the original spec and changes of current resources.</td></tr><tr><td>perfectscale.io/workload-grouping-honor-image</td><td>false</td><td>Allows PerfectScale to consider the image name in the calculated hash.</td></tr></tbody></table>

{% hint style="info" %}
If you enable automation for a custom workload type, the [WorkloadLabelsSelector](/2.0-self-hosted-or-perfectscale-documentation/enable-automation/including-a-cluster-namespace-or-workload-to-the-automation/configuring-automation-for-a-workload.md#automating-workloads-by-label) in a cluster or namespace configuration will not be applied. All workloads of that custom type will be automated despite the label's configuration.
{% endhint %}


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## 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.perfectscale.io/2.0-self-hosted-or-perfectscale-documentation/customize-workflow/ephemeral-pods-grouping.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.
