# Resource Detection

### Description

The resource detection processor can be used to detect resource information from the host, in a\
format that conforms to the [OpenTelemetry resource semantic conventions](https://opentelemetry.io/docs/concepts/semantic-conventions/), and append or override the resource value in telemetry data with this information.

### Supported Types

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

### Configuration Table

<table><thead><tr><th width="194.00390625">Field</th><th>Description</th></tr></thead><tbody><tr><td>Detector</td><td>Detector(s) to use for resource detection. Available detectors include <code>aks</code>, <code>azure</code>, <code>consul</code>, <code>ec2</code>, <code>eks</code>, <code>gcp</code>, <code>k8snode</code>, <code>openshift</code>, and <code>system</code>.</td></tr><tr><td>Override</td><td>Whether or not to overwrite existing resource attributes.</td></tr><tr><td>Timeout</td><td>Time duration after which a resource detector request will timeout.</td></tr><tr><td>Hostname Source</td><td>When the <code>system</code> detector is in use, specifies the source used to detect the system hostname. Options include <code>os</code>, <code>dns</code>, <code>cname</code>, and <code>lookup</code>.</td></tr><tr><td>EC2 Tags</td><td>Specifies a list of regex's to match to EC2 instance tag keys that will be added as resource attributes to processed data.</td></tr><tr><td>K8s Node Environment Variable</td><td>The K8s node environment variable that has the node name to retrieve metadata for. Defaults to "KUBE_NODE_NAME" because the Bindplane Collector has this automatically set.</td></tr><tr><td>Consul Address</td><td>The address of the Consul server. If unset, the environment variable "CONSUL_HTTP_ADDR" will be used if it exists.</td></tr><tr><td>Consul Authentication</td><td>The type of authentication to use with Consul. One of 'Token' or 'Token File' is required if Consul's ACL System is enabled. Options are "None", "Token", or "Token File".</td></tr><tr><td>Consul Token</td><td>Token is used to provide a per-request ACL token which overrides the collector's default token. If unset, the environment variable "CONSUL_HTTP_TOKEN" will be used if it exists.</td></tr><tr><td>Consul Token File</td><td>Token File is a file containing the current token to use for this client. If provided, it is read once at startup and never again. If unset, the environment variable "CONSUL_HTTP_TOKEN_FILE" will be used if it exists.</td></tr><tr><td>Consul Datacenter</td><td>Optional Consul Datacenter to use. If not provided, the default collector datacenter is used.</td></tr><tr><td>Consul Namespace</td><td>Optional namespace to attach to each Consul request. If unset, the environment variable "CONSUL_NAMESPACE" will be used if it exists.</td></tr><tr><td>Consul Metadata Labels</td><td>Allowlist of Consul Metadata keys to use as resource attributes.</td></tr></tbody></table>

{% hint style="info" %}
**NOTE**

Multiple detectors may be selected on a single processor. However, if multiple processors use a common attribute name, the first detector will have precedent. For more info, see this OTel [documentation](https://github.com/open-telemetry/opentelemetry-collector-contrib/tree/main/processor/resourcedetectionprocessor#ordering).
{% endhint %}

### Example Configurations

#### Google Compute Engine (GCE)

In this example, the Resource Detection Processor is configured to use the [GCP detector](https://github.com/open-telemetry/opentelemetry-collector-contrib/tree/main/processor/resourcedetectionprocessor#gce-metadata) to detect GCE resource attributes.

<figure><img src="https://1405008107-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FgmiOMzBfoNFwmKJFHMcJ%2Fuploads%2Fgit-blob-c55aa9734733943fff2ed1aaf051941472110fc7%2Fintegrations-processors-resource-detection-image-1.png?alt=media" alt="Bindplane docs - Resource Detection - image 1"><figcaption></figcaption></figure>

<figure><img src="https://1405008107-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FgmiOMzBfoNFwmKJFHMcJ%2Fuploads%2Fgit-blob-6f8f22eda32ca3236ca4e7bf4a7963f3dbe6f676%2Fintegrations-processors-resource-detection-image-2.png?alt=media" alt="Bindplane docs - Resource Detection - image 2"><figcaption></figcaption></figure>

#### Amazon EC2

In this example, the Resource Detection Processor is configured to use the [EC2 detector](https://github.com/open-telemetry/opentelemetry-collector-contrib/tree/main/processor/resourcedetectionprocessor#aws-ec2).

<figure><img src="https://1405008107-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FgmiOMzBfoNFwmKJFHMcJ%2Fuploads%2Fgit-blob-67800d82cba7102e2e852d554f8ce63ba30cbc51%2Fintegrations-processors-resource-detection-image-3.png?alt=media" alt="Bindplane docs - Resource Detection - image 3"><figcaption></figcaption></figure>

<figure><img src="https://1405008107-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FgmiOMzBfoNFwmKJFHMcJ%2Fuploads%2Fgit-blob-674711b2a4bc6c8e2791e03d5e06715137a62d00%2Fintegrations-processors-resource-detection-image-4.png?alt=media" alt="Bindplane docs - Resource Detection - image 4"><figcaption></figcaption></figure>

#### Azure Compute Instance

In this example, the Resource Detection Processor is configured to use the [Azure detector](https://github.com/open-telemetry/opentelemetry-collector-contrib/tree/main/processor/resourcedetectionprocessor#azure) to detect Azure Virtual Machine resource attributes.

<figure><img src="https://1405008107-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FgmiOMzBfoNFwmKJFHMcJ%2Fuploads%2Fgit-blob-04da08a7145db40d494aeee95c2ac0bd8a98e46d%2Fintegrations-processors-resource-detection-image-5.png?alt=media" alt="Bindplane docs - Resource Detection - image 5"><figcaption></figcaption></figure>

<figure><img src="https://1405008107-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FgmiOMzBfoNFwmKJFHMcJ%2Fuploads%2Fgit-blob-e0fe674143e9be60c10f735cb7b9ea7557900725%2Fintegrations-processors-resource-detection-image-6.png?alt=media" alt="Bindplane docs - Resource Detection - image 6"><figcaption></figcaption></figure>

#### Kubernetes

The Resource Detection Processor can detect Kubernetes resources on the following platforms: GKE, Amazon EKS, Azure AKS.

Using the GCP detector, you can detect cloud-based Kubernetes resources.

<figure><img src="https://1405008107-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FgmiOMzBfoNFwmKJFHMcJ%2Fuploads%2Fgit-blob-c55aa9734733943fff2ed1aaf051941472110fc7%2Fintegrations-processors-resource-detection-image-1.png?alt=media" alt="Bindplane docs - Resource Detection - image 7"><figcaption></figcaption></figure>

<figure><img src="https://1405008107-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FgmiOMzBfoNFwmKJFHMcJ%2Fuploads%2Fgit-blob-481cf95bbff4d0b42e3ad1d0650982b6ce779c26%2Fintegrations-processors-resource-detection-image-8.png?alt=media" alt="Bindplane docs - Resource Detection - image 8"><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/resource-detection.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.
