Whenever you need to modify attributes of a log, metric or span at the record level you can use the Attributes Processor.
-
Run the otelcol using prepared config file
otelcol-contrib --config config.yaml
-
Read the Attributes Processor documentation
-
Using the Attributes Processor insert
my.custom.attribute
attribute withmy custom value
value. You should see this attribute added to every record:Data point attributes: -> my.custom.attribute: STRING(my custom value)