Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add spec for 'span.sync' field #802

Merged
merged 2 commits into from
Jun 8, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 11 additions & 0 deletions specs/agents/tracing-spans.md
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,17 @@ Each span will have a `name`, which is a descriptive, low-cardinality string.

If a span is created without a valid `name`, the string `"unnamed"` SHOULD be used.

### Span `sync`

Span execution within a transaction or span can be synchronous (the caller waits for completion), or asynchronous (the caller does not wait
for completion).
Comment on lines +38 to +39
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe here we should clarify that the agents should only be able to capture the (a)synchronous "nature" of a specific span, for example when a synchronous or asynchronous API is used.

It might sound obvious, but if an asynchronous span is (mis)used in a synchronous way this can't easily be detected by agents at runtime, so from the user perspective it's only in the "shape" of the trace and the relative position of the blocking or async spans that we can infer if that's an issue or not.

Few examples:

  • an asynchronous API is used in a blocking way: having the async span making the parent span/transaction longer indicates that refactoring code could help.
  • starting multiple async tasks from a single span/transaction and then awaiting their completion in a blocking way would not be considered a problem because the async tasks are started in parallel. However, doing the same with a single span would make it fall in the "async API used in a blocking way" described above.


In UI:

- when `sync` field is not present or `null`, we assume it's the platform default and no badge is shown.
- when `sync` field is set to `true`, a `blocking` badge is shown in traces where the platform default is `async`: `nodejs`, `rum` and `javascript`
- when `sync` field is set to `false`, an `async` badge is shown in traces where the platform default is `blocking`: other agents

### Span outcome

The `outcome` property denotes whether the span represents a success or failure, it is used to compute error rates
Expand Down