OpenTelemetry Collector Processors
Attributes Processor
The attributes processor modifies attributes of a span, log, or metric. This processor also supports the ability to filter and match input data to determine if they should be included or excluded for specified actions.
It takes a list of actions that are performed in the order specified in the config. The supported actions are:
insert
: Inserts a new attribute in input data where the key does not already exist.update
: Updates an attribute in input data where the key does exist.upsert
: Performs insert or update. Inserts a new attribute in input data where the key does not already exist and updates an attribute in input data where the key does exist.delete
: Deletes an attribute from the input data.hash
: Hashes (SHA1) an existing attribute value.extract
: Extracts values using a regular expression rule from the input key to target keys specified in the rule. If a target key already exists, it will be overridden.
We are going to create an attributes processor to insert
a new attribute to all our host metrics called participant.name
with a value of your name e.g. marge_simpson
.
Ensure you replace INSERT_YOUR_NAME_HERE
with your name and also ensure you do not use spaces in your name.
Later on in the workshop, we will use this attribute to filter our metrics in Splunk Observability Cloud.
processors:
batch:
resourcedetection/system:
detectors: [system]
system:
hostname_sources: [os]
resourcedetection/ec2:
detectors: [ec2]
attributes/conf:
actions:
- key: participant.name
action: insert
value: "INSERT_YOUR_NAME_HERE"
Configuration Check-in
That’s processors covered, let’s check our configuration changes.