Skip to content

Actions

Actions run in order when a rule matches. Trace actions act on the whole trace and can only be used on the rule itself. Span actions act on the matched span and can also be used inside For Descendant Spans. Most actions can appear only once in a rule’s action list; the attribute-setting and redaction actions can repeat.

Span. Sets an attribute on the span. The value can be a template that reads the span’s other attributes: {http.method} {http.route}. Set while the span is open, or on what’s sent if it has already ended.

Trace. Sets an attribute on every span of the trace: spans that already ended, and spans that end later. A span’s own value for the same key wins. The value can be a template, read from the span that matched the rule.

Trace. Sets an attribute on the trace’s local root span, replacing any value it had. The value can be a template, read from the span that matched the rule.

Span. Replaces an attribute’s value before it leaves the process:

  • Replace with text: a fixed string, [Redacted] by default.
  • Mask: keeps the first and last characters, like p****d.
  • Type and length: like String<8>.

The original value is never exported or archived, even when the attribute is set again later.

Span. Removes the span. With Reparent children (the default) its children move up to the nearest kept ancestor, so the trace stays connected; with Don’t reparent they’re dropped with it.

With Don’t reparent:

Trace. Drops every span of the trace. It beats every sample rate. See Sampling.

Trace. Drops the trace unless any span in it has an error.

Trace. Keeps 1 in N traces, decided by trace ID, and sets SampleRate on the spans sent. Its mode, If Not Set or Overriding Any Existing Sampling, says whether it replaces a rate an earlier rule set. See Sampling.

Span. Keeps 1 in N of the matched spans inside a kept trace, decided by span ID. A span not kept is dropped and its children move up; a kept one carries SampleRate = trace rate × span rate. Same modes as Set Sample Rate. See Sampling.

Span. Changes the span’s name. Like attribute values, the name can be a template: {http.method} {http.route}.

Span. Removes every attribute whose key matches one of the rule’s own Span Attribute Key conditions, so a rule needs one. Applied as the span is sent, after redactions, so keys set after the rule ran are caught too. SpanSlice’s own spanslice.* attributes and SampleRate are never touched.

Span. Moves every attribute whose key matches one of the rule’s Span Attribute Key conditions under a prefix, such as legacy.. Applied like Drop Matched Attributes; if one rule drops a key and another prefixes it, it’s dropped.

Span. Removes the span and copies its attributes onto its children, which move up to its parent. Useful for wrapper spans whose only value is an attribute or two.

  • Attributes: all of them, all except a list, or only a list.
  • Conflicts, when a child already has the key: Keep child attribute leaves the child’s value; Keep parent attribute and Ignore conflicts write the collapsed span’s value over it.

When several ancestors collapse, the outermost applies first.

Span. Runs nested actions on the matched span’s descendants, optionally only those matching their own conditions. Only span actions can go inside, and it can’t be nested in itself.

Span. Replaces a run of like spans with one summary span when the trace is sent, so a loop of a thousand Redis calls leaves as one span. Spans are grouped by parent, name and the values of the group by attributes, and a group needs at least the minimum count (2 by default).

The summary span runs from the first member’s start to the last member’s end, keeps the attributes every member shares, has ERROR status if any member did, and carries spanslice.rollup.count, spanslice.rollup.error_count and spanslice.rollup.duration_ms.sum, .min, .max and .avg. The members’ children move under the summary.

Span. No later rule runs for this span at this stage.