Skip to content

Write your first rule

Rules live under Traces › Rules in the app. A rule reads as a sentence:

When a root span is completed and matches Span Attribute http.route is /healthz, then Drop Trace.

Each part is a choice in the editor:

  • Which spans the rule looks at: any span, a root span, or a child span.
  • When it runs: as the span is created, or once it has completed. A completed span knows more (its duration, its end attributes, whether it errored). http.route is only set when an HTTP span ends, so this rule runs at completion.
  • Conditions that the span must match. A rule with no conditions matches every span it looks at.
  • Actions to take on a match, run in order.

Traces › Rules › Test runs your rules against example spans, or spans from your archive, with the same engine the SDK uses. It steps through each rule and shows which conditions matched and what each action did.

Saved rules reach running services within seconds over the SDK’s live connection, without a restart. A change applies to traces that start after it arrives; traces already in flight finish under the rules they started with.

Next, read how rules run for the details that matter once you have more than one.