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

trace: Span API polish #988

Merged
merged 5 commits into from
Mar 18, 2019
Merged

trace: Span API polish #988

merged 5 commits into from
Mar 18, 2019

Conversation

hawkw
Copy link
Member

@hawkw hawkw commented Mar 18, 2019

This branch makes the following changes to tokio-trace's Span type:

  • Remove manual close API from spans
    In practice, there wasn't really a use-case for this, and it
    complicates the implementation a bit. We can always add it back later.

  • Remove generic lifetime from Span
    Again, there wasn't actually a use-case for spans with metadata that
    doesn't live for the static lifetime, and it made using Spans in
    other types somewhat inconvenient. It's also possible to implement an
    alternative API for non-static spans on top of the tokio-trace-core
    primitives.

Signed-off-by: Eliza Weisman [email protected]

hawkw added 3 commits March 13, 2019 14:11
In practice, there wasn't really a use-case for this, and it complicates
the implementation.

We can always add it back later.

Signed-off-by: Eliza Weisman <[email protected]>'
Again, there wasn't actually a use-case for spans with metadata that
doesn't live for the static lifetime, and it made using `Span`s in other
types somewhat more challenging. It's also possible to implement an
alternative API for non-static spans on top of the `tokio-trace-core`
primitives.

Signed-off-by: Eliza Weisman <[email protected]>
@hawkw hawkw self-assigned this Mar 18, 2019
Copy link
Member

@LucioFranco LucioFranco left a comment

Choose a reason for hiding this comment

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

im all for this, im using static stuff anyways so 👍

@@ -154,18 +142,11 @@ use {
/// span will silently do nothing. Thus, the handle can be used in the same
/// manner regardless of whether or not the trace is currently being collected.
#[derive(Clone, PartialEq, Hash)]
pub struct Span<'a> {
pub struct Span {
Copy link
Member

Choose a reason for hiding this comment

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

this means we can drop the lifetime from tokio_trace_futures::Instrumented?

Copy link
Member Author

Choose a reason for hiding this comment

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

Yes; in fact, this will break the current Instrumented.

Copy link
Member

Choose a reason for hiding this comment

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

Works for me! its an easy upgrade

Copy link
Member

@davidbarsky davidbarsky left a comment

Choose a reason for hiding this comment

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

+1 on tests passing

@hawkw hawkw merged commit 8548772 into master Mar 18, 2019
@hawkw hawkw deleted the eliza/trace-api-polish-2 branch March 18, 2019 19:44
hawkw added a commit to tokio-rs/tracing that referenced this pull request Mar 19, 2019
hawkw added a commit to tokio-rs/tracing that referenced this pull request Mar 20, 2019
tokio-rs/tokio#988 removed the generic lifetime parameter from
`Span`. This branch updates the nursery crates to match.

Signed-off-by: Eliza Weisman <[email protected]>
@hawkw hawkw added this to the tokio-trace v0.1 milestone Mar 27, 2019
hawkw added a commit that referenced this pull request Jun 25, 2019
This branch makes the following changes to `tokio-trace`'s `Span` type:

* **Remove manual close API from spans**
  In practice, there wasn't really a use-case for this, and it 
  complicates the implementation a bit. We can always add it back later.

* **Remove generic lifetime from `Span`**
  Again, there wasn't actually a use-case for spans with metadata that
  doesn't live for the static lifetime, and it made using `Span`s in 
  other types somewhat inconvenient. It's also possible to implement an
  alternative API for non-static spans on top of the `tokio-trace-core`
  primitives.

Signed-off-by: Eliza Weisman <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants