Skip to main content

Resource Processor

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

Supported Telemetry

Logs Metrics Traces

Overview

[!NOTE] This component has been superseded by the transform processor. Migrate to using it instead.
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.

Supported Actions

  • INSERT: Inserts the key/value to attributes when the key does not exist
  • UPDATE: Updates an existing key with a value
  • UPSERT: Performs insert or update depending on whether the key exists
  • DELETE: Deletes the attribute
  • HASH: Computes the SHA-256 hash of an existing value
  • EXTRACT: Extracts values using a regular expression

Default Values

The default_value field can be used to specify a fallback value when the primary value source (e.g., attribute, or context value) is not available. This is useful for:
  • Providing sensible defaults when attributes don’t exist
  • Ensuring the pipeline doesn’t fail due to missing configuration
Examples:
Refer to config.yaml for detailed examples on using the processor.

Warnings

In general, the Resource processor is a very safe processor to use. Care only needs to be taken when modifying resource attributes of metrics:
  • Identity Conflict: Resource attributes are part of a metric stream’s identity. Deleting or changing existing resource attributes (e.g., with the delete, update or upsert actions) has the potential to create an identity conflict, since the Resource processor does not perform any re-aggregation of the data points. Adding new resource attributes is safe. For example, two pods of the same service send the same counter. Their resources differ only by k8s.pod.name:
    Before the processor these are two separate streams. After it, both pods report http.server.requests with the same resource, so the backend merges them into one stream and receives 1000, 50, 1010, 60, 1020, 70. Every drop (e.g. 1000 to 50) looks like a counter reset, so rates and totals become wrong.

Configuration

Example Configuration


Last generated: 2026-11-09