# External labels

Copy as Markdown[Open in ChatGPT](https://chatgpt.com/?q=Read%20https%3A%2F%2Fdocs-docusaurus.kinsta.page%2Fintegrations%2Fmetrics%2Fexternal-labels.md%20and%20help%20me%20with%20my%20question%20about%20this%20Coralogix%20documentation%20page.)[Open in Claude](https://claude.ai/new?q=Read%20https%3A%2F%2Fdocs-docusaurus.kinsta.page%2Fintegrations%2Fmetrics%2Fexternal-labels.md%20and%20help%20me%20with%20my%20question%20about%20this%20Coralogix%20documentation%20page.)

Send Coralogix your metrics using **external labels**, maximizing query performance and adding an extra layer of granularity in your data indexing.

## Feature[​](#feature "Direct link to Feature")

When you send us your data using [Prometheus](https://docs-docusaurus.kinsta.page/integrations/metrics/prometheus/.md) or another agent, you now have the option of using **external labels** with your metrics.

**External labels** mark label names that already exist in your data as a partition key. Using these labels, they differentiate metrics from different environments, allowing the creation of a **separate index for each data source producing metrics**. When you query your data from a particular environment, our system will only load the index associated with that environment, **maximizing** **query performance**.

### Example[​](#example "Direct link to Example")

If using, for instance, `external_labels=cluster` , Coralogix will extract the `cluster` label from your ingested metrics and then put all metrics with a particular timeseries value `cluster=cluster_eu` in one index group and another timeseries value `cluster=cluster_us` in another index group.

## Configuration[​](#configuration "Direct link to Configuration")

The following is an example configuration for one **external label** using the [Prometheus remote\_write URL](https://docs-docusaurus.kinsta.page/integrations/metrics/prometheus/.md).

```
remote_write:

- url:<https://ingress.eu2.coralogix.com/prometheus/v1?external_labels=cluster>

  name: '<customer_name>'

  remote_timeout: 120s

  bearer_token: '<Send_Your_Data_private_key>'
```

The following is an example configuration for two external labels using the [Prometheus remote\_write URL](https://docs-docusaurus.kinsta.page/integrations/metrics/prometheus/.md).

```
remote_write:

- url:<https://ingress.eu2.coralogix.com/prometheus/v1?external_labels=region&external_labels=cluster>

  name: '<customer_name>'

  remote_timeout: 120s

  bearer_token: '<Send_Your_Data_private_key>'
```

**Notes**:

* **External labels** are attached to the URL.

* The configuration requires that you input your Coralogix [Send-Your-Data API key](https://docs-docusaurus.kinsta.page/user-guides/account-management/api-keys/send-your-data-api-key/.md).

## Best Practices[​](#best-practices "Direct link to Best Practices")

Follow these guidelines as best practices for using **external labels**:

* **Use external labels to refer to the name of a data source, rather than a particular value.**

For example, if `external_labels=cluster`, label values found in the timeseries may be `{cluster: prod}` and `{cluster: dev}`. The Coralogix pipeline will partition data by the `cluster` value.

* **Refrain from using external labels with many values**.

For every value of your **external label**, a new index is created. We suggest using a **maximum of 20 values per label** to ensure optimal query performance.

## Additional resources[​](#additional-resources "Direct link to Additional resources")

|                     |                                                                                                 |
| ------------------- | ----------------------------------------------------------------------------------------------- |
| Docs                | [Prometheus](https://docs-docusaurus.kinsta.page/integrations/metrics/prometheus/.md)           |
| Coralogix Endpoints | [Coralogix Endpoints](https://docs-docusaurus.kinsta.page/integrations/coralogix-endpoints/.md) |
