1
0
mirror of https://github.com/openshift/openshift-docs.git synced 2026-02-05 21:46:22 +01:00
Files
openshift-docs/modules/otel-processors-attributes-processor.adoc

56 lines
2.0 KiB
Plaintext

// Module included in the following assemblies:
//
// * observability/otel/otel-collector/otel-collector-processors.adoc
:_mod-docs-content-type: REFERENCE
[id="otel-processors-attributes-processor_{context}"]
= Attributes Processor
[role="_abstract"]
The Attributes Processor can modify attributes of a span, log, or metric. You can configure this processor to filter and match input data and include or exclude such data for specific actions.
This processor operates on a list of actions, executing them in the order specified in the configuration. The following actions are supported:
Insert:: Inserts a new attribute into the input data when the specified key does not already exist.
Update:: Updates an attribute in the input data if the key already exists.
Upsert:: Combines the insert and update actions: Inserts a new attribute if the key does not exist yet. Updates the attribute if the key already exists.
Delete:: Removes an attribute from the input data.
Hash:: Hashes an existing attribute value as SHA1.
Extract:: Extracts values by using a regular expression rule from the input key to the target keys defined in the rule. If a target key already exists, it is overridden similarly to the Span Processor's `to_attributes` setting with the existing attribute as the source.
Convert:: Converts an existing attribute to a specified type.
.OpenTelemetry Collector using the Attributes Processor
[source,yaml]
----
# ...
config:
processors:
attributes/example:
actions:
- key: db.table
action: delete
- key: redacted_span
value: true
action: upsert
- key: copy_key
from_attribute: key_original
action: update
- key: account_id
value: 2245
action: insert
- key: account_password
action: delete
- key: account_email
action: hash
- key: http.status_code
action: convert
converted_type: int
# ...
----