AutoMerge is generally available

Last updated:

Delete Attributes

Remove an attribute, or reset an OTLP field to its default, with a Delete step in a transform rule.

A Delete step removes an attribute from the record, the scope, or the resource. Use it to drop attributes that carry sensitive data or that add cardinality without value, such as a pod UID.

Delete step that removes the span attribute user.id, and the OTTL it writes

Add a Delete Step

  1. In the rule editor, click + Transformation and set Transformation to Delete. Or hover the attribute in Input sample data, click Add a transformation step, and pick Delete.
  2. Fill in the fields:
  • Target context: Where the attribute is: Resource, Scope, or the record, such as Span or Log record.
  • Target attribute: The attribute to remove, for example k8s.pod.uid.
  1. Check the Output panel: the attribute shows as removed.

Delete a Field

OTLP fields can't be removed. Deleting a field resets it to its default value: an empty text, SPAN_KIND_UNSPECIFIED for otel.span.kind, STATUS_CODE_UNSET for otel.span.status.code, and SEVERITY_NUMBER_UNSPECIFIED for otel.log.severity_number.

Delete step on the span field otel.span.kind, with the note that OTLP fields can't be removed and deleting a field resets it to its default value

Example

Deleting k8s.pod.uid from the resource writes this OpenTelemetry Transformation Language (OTTL) statement:

text
delete_key(resource.attributes, "k8s.pod.uid")

Deleting otel.span.status.message writes:

text
set(span.status.message, "")

Limits

  • Writable keys: You can't delete a protected or read-only attribute.
  • No undo after storage: A deleted attribute is not stored. Check the Output panel before you save the rule.

Further Reading