AutoMerge is generally available

Last updated:

Rename Attributes

Give an attribute a new key with a Rename step in a transform rule, for example to align attribute names across services.

A Rename step gives an attribute a new key and keeps its value, within the same context. Use it to align attribute names across services, for example when one service sends userId and another sends user.id.

Transform rule editor with a Rename step that renames the span attribute http.route to route, and the Output panel showing http.route removed and route added

Add a Rename Step

  1. In the rule editor, click + Transformation and set Transformation to Rename. Or hover the attribute in Input sample data, click Add a transformation step, and pick Rename. That fills in the source for you.
  2. Fill in the fields:
  • Source context: Where the attribute is: Resource, Scope, or the record, such as Span or Log record.
  • Source attribute: The key to rename, for example http.route.
  • Target attribute: The new key, for example route.
  1. Check the Output panel: the old key shows as removed and the new key as added, with the same value.

Example

Renaming userId to user.id on spans writes these OpenTelemetry Transformation Language (OTTL) statements:

text
set(attributes["user.id"], attributes["userId"])
delete_key(attributes, "userId")

Limits

  • Attributes only: OTLP fields, such as otel.span.name or otel.log.body, can't be renamed. To put a field's value in an attribute, use Copy.
  • Same context: The attribute stays in its context. To move it to another context, use Move.
  • Writable keys: Rename changes both keys, so neither may be protected or read-only.

Further Reading