Docs » Get started with the Splunk Distribution of the OpenTelemetry Collector » Collector components » Collector components: Processors » Resource processor

Resource processor ๐Ÿ”—

The resource processor is an OpenTelemetry Collector component that can add, update, or delete resource attributes. The supported pipeline types are traces, metrics, and logs. See Process your data with pipelines for more information.

The resource processor is useful when you want to add attributes that your instrumentation doesnโ€™t provide, or when you need to override the value of attributes collected by receivers using other attributes. To edit existing attributes, for example to obfuscate sensitive information, use the attributes processor. See Attributes processor.

Target attributes are defined through the key field. The value field contains the desired value for the attribute. Each attribute in the list requires an action. The available actions are the following:

Action

Description

insert

Adds the key-value combination to attributes when the key doesnโ€™t exist. Requires one of the following fields: value, from_attribute, or from_context.

update

Updates an existing key with a value. Requires one of the following fields: value, from_attribute, or from_context.

upsert

Adds or updates a key-value combination depending on the attributes containing the key. Requires one of the following fields: value, from_attribute, or from_context.

delete

Deletes the attribute.

hash

Hashes an existing value using the SHA-1 algorithm.

extract

Extracts values from an attribute using a regular expression to add or update the value of keys specified in the rule. Requires the pattern field.

convert

Converts the type of an existing attribute if the attribute can be converted. Requires the converted_type field.

Note

For information about the Resource Detection processor, see Resource detection processor.

Get started ๐Ÿ”—

Follow these steps to configure and activate the component:

  1. Deploy the Splunk Distribution of OpenTelemetry Collector to your host or container platform:

  2. Configure the resource processor as described in the next section.

  3. Restart the Collector.

Sample configurations ๐Ÿ”—

To activate the resource processor, add resource to the processors section of your configuration file, as shown in the following example:

resource:
  attributes:
  # Adds the attribute overriding existing values
  - key: cloud.availability_zone
    value: zone-1
    action: upsert
  # Copies the value of an attribute into another
  - key: k8s.cluster.name
    from_attribute: k8s-cluster
    action: insert
   # Removes an attribute
  - key: redundant-attribute
    action: delete

To complete the configuration, include the receiver in any pipeline of the service section of your configuration file. For example:

service:
  pipelines:
    metrics:
      processors: [resource]
    logs:
      processors: [resource]
    traces:
      processors: [resource]

Settings ๐Ÿ”—

The following table shows the configuration options for the resource processor:

Troubleshooting ๐Ÿ”—

If you are a Splunk Observability Cloud customer and are not able to see your data in Splunk Observability Cloud, you can get help in the following ways.

Available to Splunk Observability Cloud customers

Available to prospective customers and free trial users

  • Ask a question and get answers through community support at Splunk Answers .

  • Join the Splunk #observability user group Slack channel to communicate with customers, partners, and Splunk employees worldwide. To join, see Chat groups in the Get Started with Splunk Community manual.

This page was last updated on Dec 19, 2024.