Skip to content

Commit

Permalink
attributes: permit #[instrument(follows_from = …)] (#2093)
Browse files Browse the repository at this point in the history
This PR extends the `#[instrument]` attribute to accept an optional
`follows_from = …` argument that supplies any number of
`Span::follows_from` relationships to the generated `Span`.

## Motivation

This PR resolves #879.

## Solution

This PR largely follows the implementation strategy articulated by
@hawkw:
#879 (comment)

In that comment, @hawkw suggests taking one of two approaches:
1. each `follows_from` relationship is supplied with a distinct
   `follows_from` argument
2. the `follows_from` argument is provided once, and its value is a
   **list** of indirect causes

I take the second approach, since it is slightly more flexible: it
allows for the number of indirect causes to vary at runtime.

This addition is complemented by changes to `tracing-mock` to permit
making `follows_from` assertions for testing purposes.
  • Loading branch information
jswrenn authored and hawkw committed Apr 26, 2022
1 parent 3d81a89 commit f2f8aca

Sorry, this diff is temporarily unavailable due to heavy server load.

Please try again later.

0 comments on commit f2f8aca

Please sign in to comment.