Actions
Actions run in order when a rule matches. Trace actions act on the whole trace, and you can use them only on the rule itself, not inside For Descendant Spans. Span actions act on the matched span, and you can also use them inside For Descendant Spans. Most actions can appear only once in a rule’s action list. Attribute-setting and redaction actions can repeat.
Set Span Attribute
Section titled “Set Span Attribute”Span. Sets an attribute on the span. The value can be a template that reads the span’s other attributes, such as
{http.method} {http.route}. It’s set on the live span while the span is open, or on the span as sent if it has already
ended.
Set Trace Attribute
Section titled “Set Trace Attribute”Trace. Sets an attribute on every span in the trace, both spans that have already ended and spans that end later. If a span has its own value for the same key, that value wins. The value can be a template, read from the span that matched the rule.
Rules that run later can match the attribute with a Span Attribute condition. An attribute set during the root-end pass isn’t seen by the other rules in that pass.
Set Root Span Attribute
Section titled “Set Root Span Attribute”Trace. Sets an attribute on the trace’s local root span, replacing any existing value. The value can be a template, read from the span that matched the rule.
Redact Span Attribute
Section titled “Redact Span Attribute”Span. Replaces an attribute’s value before the value 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 if the attribute is set again later. Templates that read it, in Rename Span or a Set … Attribute action, get the redacted value too, whichever rule or stage runs first. The one exception: a trace or root attribute copied onto spans that were already sent before the redaction matched. Redact in the created stage to rule that out.
Drop Span
Section titled “Drop Span”Span. Removes the span. With Reparent children (the default), its children move up to the nearest kept ancestor, so the trace stays connected. With Drop children, they’re dropped too.
With Drop children:
Drop Trace
Section titled “Drop Trace”Trace. Drops every span in the trace. It overrides every sample rate. See Sampling.
Drop Traces Without Errors
Section titled “Drop Traces Without Errors”Trace. Drops the trace unless a span in it has an error.
Set Sample Rate
Section titled “Set Sample Rate”Trace. Keeps 1 in N traces, decided by trace ID, and sets SampleRate on the spans it sends. Its mode decides
whether it replaces a rate an earlier rule set. If Not Set applies only when no earlier rule set a rate.
Overriding Any Existing Sampling replaces the earlier rate. See Sampling.
Set Span Sample Rate
Section titled “Set Span Sample Rate”Span. Keeps 1 in N of the matched spans inside a kept trace, decided by span ID. A span that isn’t kept is dropped,
and its children move up. A kept span carries SampleRate = trace rate × span rate. It has the same modes as Set
Sample Rate. See Sampling.
Rename Span
Section titled “Rename Span”Span. Changes the span’s name. Like attribute values, the name can be a template, such as
{http.method} {http.route}.
Drop Attributes
Section titled “Drop Attributes”Span. Removes the attributes you list, by exact key. Enter keys one at a time, or paste a list separated by commas or new lines. It applies like Drop Matched Attributes, below: when the span is sent, so keys set after the rule ran are dropped too.
Drop Matched Attributes
Section titled “Drop Matched Attributes”Span. Removes every attribute whose key matches one of this rule’s Span Attribute Key conditions, so the rule
needs at least one. SpanSlice applies it as the span is sent, after redactions. Keys set after the rule ran are caught
too. SpanSlice never touches its own spanslice.* attributes or SampleRate.
Prefix Matched Attributes
Section titled “Prefix Matched Attributes”Span. Moves every attribute whose key matches one of the rule’s Span Attribute Key conditions under a prefix,
such as legacy.. It applies like Drop Matched Attributes. If one rule drops a key and another prefixes it, the key is
dropped.
Collapse Span
Section titled “Collapse Span”Span. Removes the span, copies its attributes onto its children, and moves the children up to its parent. Use it 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.
For Descendant Spans
Section titled “For Descendant Spans”Span. Runs nested actions on the matched span’s descendants. You can give the nested actions their own conditions, so they run only on descendants that match. Only span actions go inside it. A For Descendant Spans action can’t contain another one.
Roll Up Spans
Section titled “Roll Up Spans”Span. Replaces a run of like spans with one summary span when the trace is sent. For example, a loop of a thousand Redis calls leaves as one span. SpanSlice groups spans by parent, name, and the values of the group by attributes. A group needs at least the minimum count, which is 2 by default.
The summary span runs from the first member’s start to the last member’s end. It keeps the attributes that every member shares, and it has ERROR status if any member did. It carries:
spanslice.rollup.countandspanslice.rollup.error_countspanslice.rollup.duration_ms.sum,.min,.maxand.avg, rounded to hundredths of a millisecond
The members’ children move under the summary.
The summary keeps the members’ name unless rename is on, which names it {name} (rollup), so
HSCAN becomes HSCAN (rollup). Grouping still uses the members’ own name.
Stop Rule Evaluation
Section titled “Stop Rule Evaluation”Span. No later rule runs for this span at this stage.