Skip to main content

Resource Processor

Status Available in: core, contrib, k8s Maintainers: @dmitryax Source: opentelemetry-collector-contrib

Supported Telemetry

Logs Metrics Traces

Overview

The resource processor can be used to apply changes on resource attributes. Please refer to config.go for the config spec. attributes represents actions that can be applied on resource attributes. See Attributes Processor for more details on supported attributes actions. Examples:
processors:
  resource:
    attributes:
    - key: cloud.availability_zone
      value: "zone-1"
      action: upsert
    - key: k8s.cluster.name
      from_attribute: k8s-cluster
      action: insert
    - key: redundant-attribute
      action: delete
Refer to config.yaml for detailed examples on using the processor.

Configuration

Example Configuration

# The following specifies a resource configuration doing the changes on resource attributes:
# 1. Set "cloud.availability_zone" attributes with "zone-1" value ignoring existing values.
# 2. Copy "k8s-cluster" attribute value to "k8s.cluster.name" attribute, nothing happens if "k8s-cluster" not found.
# 3. Remove "redundant-attribute" attribute.
# There are many more attribute modification actions supported,
# check processor/attributesprocessor/testdata/config.yaml for reference.
resource:
  attributes:
  - key: cloud.availability_zone
    value: zone-1
    action: upsert
  - key: k8s.cluster.name
    from_attribute: k8s-cluster
    action: insert
  - key: redundant-attribute
    action: delete

# The following specifies an invalid resource configuration, it has to have at least one action set in attributes field.
resource/empty:

Last generated: 2026-04-13