Skip to content

Commit

Permalink
fix: Clarify what has-root-span does (#1114)
Browse files Browse the repository at this point in the history
Noted in pollinators:
https://honeycombpollinators.slack.com/archives/C01BZ3J7RMJ/p1714601065818559

---------

Co-authored-by: Kent Quirk <kentquirk@honeycomb.io>
  • Loading branch information
cartermp and kentquirk authored May 3, 2024
1 parent 36b6fc7 commit bd3c107
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 0 deletions.
2 changes: 2 additions & 0 deletions rules_complete.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -108,6 +108,8 @@ Samplers:
- Name: drop incomplete traces from the buggy service
Drop: true
Conditions:
# NOTE: has-root-span only checks if the trace has a root span.
# It does NOT act as a shorthand for evaluating the root span; use the `root.` construct for that.
- Operator: has-root-span
Value: false
- Field: service.name
Expand Down
9 changes: 9 additions & 0 deletions rules_conditions.md
Original file line number Diff line number Diff line change
Expand Up @@ -201,6 +201,15 @@ For most cases, use `not-exists` in a rule with a scope of "span".
WARNING: Rules can have `Scope: trace` or `Scope: span`; `not-exists` used with `Scope: trace` will be true if **any** single span in the entire trace matches the negative condition.
This is almost never desired behavior.

### has-root-span

Tests if the trace as a whole has a root span.

The `Value` parameter can either be `true` or `false`.

NOTE: `has-root-span` does not check if a given span **is** a root span,
it checks if the containing trace **has** a root span.

### `matches`

Tests if the span value specified by the `Field` parameter matches the regular expression specified by the `Value` parameter.
Expand Down

0 comments on commit bd3c107

Please sign in to comment.