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, such as its duration, its end attributes, and whether it errored. http.route is set only when an HTTP span ends, so this rule runs at completion.
  • Conditions 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 against spans from your archive. It uses the same engine as the SDK. 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. No restart is needed. 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. It covers the details that matter once you have more than one rule.