-
Notifications
You must be signed in to change notification settings - Fork 743
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
Unify span traversal #1429
Labels
kind/feature
New feature or request
Comments
nightkr
added a commit
to Appva/tracing
that referenced
this issue
Jun 9, 2021
Merged
hawkw
pushed a commit
that referenced
this issue
Jun 22, 2021
## Motivation Fixes #1429 ## Solution Implemented as described in #1429, and migrated all internal uses of the deprecated methods. All tests passed both before and after the migration (9ec8130). - Add a new method `SpanRef::scope(&self)` that returns a leaf-to-root `Iterator`, including the specified leaf - Add a new method `Scope::from_root(self)` (where `Scope` is the type returned by `SpanRef::scope` defined earlier) that returns a root-to-leaf `Iterator` that ends at the current leaf (in other words: it's essentially the same as `Scope::collect::<Vec<_>>().into_iter().rev()`) - Deprecate all existing iterators, since they can be replaced by the new unified mechanism: - `Span::parents` is equivalent to `Span::scope().skip(1)` (although the `skip` is typically a bug) - `Span::from_root` is equivalent to `Span::scope().skip(1).from_root()` (although the `skip` is typically a bug) - `Context::scope` is equivalent to `Context::lookup_current().scope().from_root()` (although the `lookup_current` is sometimes a bug, see also #1428)
nightkr
added a commit
to Appva/tracing
that referenced
this issue
Jun 24, 2021
Fixes tokio-rs#1429 (forwardport from v0.1.x branch) Implemented as described in tokio-rs#1429, and migrated all internal uses of the deprecated methods. All tests passed both before and after the migration (9ec8130). - Add a new method `SpanRef::scope(&self)` that returns a leaf-to-root `Iterator`, including the specified leaf - Add a new method `Scope::from_root(self)` (where `Scope` is the type returned by `SpanRef::scope` defined earlier) that returns a root-to-leaf `Iterator` that ends at the current leaf (in other words: it's essentially the same as `Scope::collect::<Vec<_>>().into_iter().rev()`) - Deprecate all existing iterators, since they can be replaced by the new unified mechanism: - `Span::parents` is equivalent to `Span::scope().skip(1)` (although the `skip` is typically a bug) - `Span::from_root` is equivalent to `Span::scope().skip(1).from_root()` (although the `skip` is typically a bug) - `Context::scope` is equivalent to `Context::lookup_current().scope().from_root()` (although the `lookup_current` is sometimes a bug, see also tokio-rs#1428)
gilescope
added a commit
to gilescope/substrate
that referenced
this issue
Aug 6, 2021
gilescope
added a commit
to paritytech/substrate
that referenced
this issue
Aug 13, 2021
Remove unneeded dependencies and dev-dependencies. Made self_destruct test not dependent on wasm bin size. Updated code related to deprecated warning on tracing-subscriber `scope()` ( See tokio-rs/tracing#1429 )
akshayknarayan
added a commit
to akshayknarayan/tracing-timing
that referenced
this issue
Mar 9, 2022
`SpanRef::parent()` was deprecated in tracing-subscriber v0.3, but as noted at tokio-rs/tracing#1429 it is equivalent to `Span::scope().skip(1)`, so we use that instead.
taqtiqa-mark
pushed a commit
to subversive-upstream/polkadot-sdk-substrate-frame-aura
that referenced
this issue
Sep 14, 2023
Remove unneeded dependencies and dev-dependencies. Made self_destruct test not dependent on wasm bin size. Updated code related to deprecated warning on tracing-subscriber `scope()` ( See tokio-rs/tracing#1429 )
taqtiqa-mark
pushed a commit
to subversive-upstream/polkadot-sdk-substrate-frame-authorship
that referenced
this issue
Sep 14, 2023
Remove unneeded dependencies and dev-dependencies. Made self_destruct test not dependent on wasm bin size. Updated code related to deprecated warning on tracing-subscriber `scope()` ( See tokio-rs/tracing#1429 )
taqtiqa-mark
pushed a commit
to subversive-upstream/polkadot-sdk-substrate-frame-authority-discovery
that referenced
this issue
Sep 14, 2023
Remove unneeded dependencies and dev-dependencies. Made self_destruct test not dependent on wasm bin size. Updated code related to deprecated warning on tracing-subscriber `scope()` ( See tokio-rs/tracing#1429 )
taqtiqa-mark
pushed a commit
to subversive-upstream/polkadot-sdk-substrate-frame-benchmarking
that referenced
this issue
Sep 14, 2023
Remove unneeded dependencies and dev-dependencies. Made self_destruct test not dependent on wasm bin size. Updated code related to deprecated warning on tracing-subscriber `scope()` ( See tokio-rs/tracing#1429 )
taqtiqa-mark
pushed a commit
to subversive-upstream/polkadot-sdk-substrate-frame-bounties
that referenced
this issue
Sep 14, 2023
Remove unneeded dependencies and dev-dependencies. Made self_destruct test not dependent on wasm bin size. Updated code related to deprecated warning on tracing-subscriber `scope()` ( See tokio-rs/tracing#1429 )
taqtiqa-mark
pushed a commit
to subversive-upstream/polkadot-sdk-substrate-frame-collective
that referenced
this issue
Sep 14, 2023
Remove unneeded dependencies and dev-dependencies. Made self_destruct test not dependent on wasm bin size. Updated code related to deprecated warning on tracing-subscriber `scope()` ( See tokio-rs/tracing#1429 )
taqtiqa-mark
pushed a commit
to subversive-upstream/polkadot-sdk-substrate-frame-election-provider-multi-phase
that referenced
this issue
Sep 14, 2023
Remove unneeded dependencies and dev-dependencies. Made self_destruct test not dependent on wasm bin size. Updated code related to deprecated warning on tracing-subscriber `scope()` ( See tokio-rs/tracing#1429 )
taqtiqa-mark
pushed a commit
to subversive-upstream/polkadot-sdk-substrate-frame-democracy
that referenced
this issue
Sep 14, 2023
Remove unneeded dependencies and dev-dependencies. Made self_destruct test not dependent on wasm bin size. Updated code related to deprecated warning on tracing-subscriber `scope()` ( See tokio-rs/tracing#1429 )
taqtiqa-mark
pushed a commit
to subversive-upstream/polkadot-sdk-substrate-frame-elections-phragmen
that referenced
this issue
Sep 14, 2023
Remove unneeded dependencies and dev-dependencies. Made self_destruct test not dependent on wasm bin size. Updated code related to deprecated warning on tracing-subscriber `scope()` ( See tokio-rs/tracing#1429 )
taqtiqa-mark
pushed a commit
to subversive-upstream/polkadot-sdk-substrate-frame-contracts
that referenced
this issue
Sep 14, 2023
Remove unneeded dependencies and dev-dependencies. Made self_destruct test not dependent on wasm bin size. Updated code related to deprecated warning on tracing-subscriber `scope()` ( See tokio-rs/tracing#1429 )
taqtiqa-mark
pushed a commit
to subversive-upstream/polkadot-sdk-substrate-frame-executive
that referenced
this issue
Sep 14, 2023
Remove unneeded dependencies and dev-dependencies. Made self_destruct test not dependent on wasm bin size. Updated code related to deprecated warning on tracing-subscriber `scope()` ( See tokio-rs/tracing#1429 )
taqtiqa-mark
pushed a commit
to subversive-upstream/polkadot-sdk-substrate-frame-im-online
that referenced
this issue
Sep 14, 2023
Remove unneeded dependencies and dev-dependencies. Made self_destruct test not dependent on wasm bin size. Updated code related to deprecated warning on tracing-subscriber `scope()` ( See tokio-rs/tracing#1429 )
taqtiqa-mark
pushed a commit
to subversive-upstream/polkadot-sdk-substrate-frame-merkle-mountain-range
that referenced
this issue
Sep 14, 2023
Remove unneeded dependencies and dev-dependencies. Made self_destruct test not dependent on wasm bin size. Updated code related to deprecated warning on tracing-subscriber `scope()` ( See tokio-rs/tracing#1429 )
taqtiqa-mark
pushed a commit
to subversive-upstream/polkadot-sdk-substrate-frame-lottery
that referenced
this issue
Sep 14, 2023
Remove unneeded dependencies and dev-dependencies. Made self_destruct test not dependent on wasm bin size. Updated code related to deprecated warning on tracing-subscriber `scope()` ( See tokio-rs/tracing#1429 )
taqtiqa-mark
pushed a commit
to subversive-upstream/polkadot-sdk-substrate-frame-multisig
that referenced
this issue
Sep 14, 2023
Remove unneeded dependencies and dev-dependencies. Made self_destruct test not dependent on wasm bin size. Updated code related to deprecated warning on tracing-subscriber `scope()` ( See tokio-rs/tracing#1429 )
taqtiqa-mark
pushed a commit
to subversive-upstream/polkadot-sdk-substrate-frame-offences
that referenced
this issue
Sep 14, 2023
Remove unneeded dependencies and dev-dependencies. Made self_destruct test not dependent on wasm bin size. Updated code related to deprecated warning on tracing-subscriber `scope()` ( See tokio-rs/tracing#1429 )
taqtiqa-mark
pushed a commit
to subversive-upstream/polkadot-sdk-substrate-frame-proxy
that referenced
this issue
Sep 14, 2023
Remove unneeded dependencies and dev-dependencies. Made self_destruct test not dependent on wasm bin size. Updated code related to deprecated warning on tracing-subscriber `scope()` ( See tokio-rs/tracing#1429 )
taqtiqa-mark
pushed a commit
to subversive-upstream/polkadot-sdk-substrate-frame-recovery
that referenced
this issue
Sep 14, 2023
Remove unneeded dependencies and dev-dependencies. Made self_destruct test not dependent on wasm bin size. Updated code related to deprecated warning on tracing-subscriber `scope()` ( See tokio-rs/tracing#1429 )
taqtiqa-mark
pushed a commit
to subversive-upstream/polkadot-sdk-substrate-frame-session
that referenced
this issue
Sep 14, 2023
Remove unneeded dependencies and dev-dependencies. Made self_destruct test not dependent on wasm bin size. Updated code related to deprecated warning on tracing-subscriber `scope()` ( See tokio-rs/tracing#1429 )
taqtiqa-mark
pushed a commit
to subversive-upstream/polkadot-sdk-substrate-frame-try-runtime
that referenced
this issue
Sep 14, 2023
Remove unneeded dependencies and dev-dependencies. Made self_destruct test not dependent on wasm bin size. Updated code related to deprecated warning on tracing-subscriber `scope()` ( See tokio-rs/tracing#1429 )
taqtiqa-mark
pushed a commit
to subversive-upstream/polkadot-sdk-substrate-frame-transaction-storage
that referenced
this issue
Sep 14, 2023
Remove unneeded dependencies and dev-dependencies. Made self_destruct test not dependent on wasm bin size. Updated code related to deprecated warning on tracing-subscriber `scope()` ( See tokio-rs/tracing#1429 )
taqtiqa-mark
pushed a commit
to subversive-upstream/polkadot-sdk-substrate-frame-staking
that referenced
this issue
Sep 14, 2023
Remove unneeded dependencies and dev-dependencies. Made self_destruct test not dependent on wasm bin size. Updated code related to deprecated warning on tracing-subscriber `scope()` ( See tokio-rs/tracing#1429 )
taqtiqa-mark
pushed a commit
to subversive-upstream/polkadot-sdk-substrate-frame-timestamp
that referenced
this issue
Sep 14, 2023
Remove unneeded dependencies and dev-dependencies. Made self_destruct test not dependent on wasm bin size. Updated code related to deprecated warning on tracing-subscriber `scope()` ( See tokio-rs/tracing#1429 )
taqtiqa-mark
pushed a commit
to subversive-upstream/polkadot-sdk-substrate-frame-transaction-payment
that referenced
this issue
Sep 14, 2023
Remove unneeded dependencies and dev-dependencies. Made self_destruct test not dependent on wasm bin size. Updated code related to deprecated warning on tracing-subscriber `scope()` ( See tokio-rs/tracing#1429 )
taqtiqa-mark
pushed a commit
to subversive-upstream/polkadot-sdk-substrate-frame-treasury
that referenced
this issue
Sep 14, 2023
Remove unneeded dependencies and dev-dependencies. Made self_destruct test not dependent on wasm bin size. Updated code related to deprecated warning on tracing-subscriber `scope()` ( See tokio-rs/tracing#1429 )
taqtiqa-mark
pushed a commit
to subversive-upstream/polkadot-sdk-substrate-frame-system
that referenced
this issue
Sep 14, 2023
Remove unneeded dependencies and dev-dependencies. Made self_destruct test not dependent on wasm bin size. Updated code related to deprecated warning on tracing-subscriber `scope()` ( See tokio-rs/tracing#1429 )
taqtiqa-mark
pushed a commit
to subversive-upstream/polkadot-sdk-substrate-frame-utility
that referenced
this issue
Sep 14, 2023
Remove unneeded dependencies and dev-dependencies. Made self_destruct test not dependent on wasm bin size. Updated code related to deprecated warning on tracing-subscriber `scope()` ( See tokio-rs/tracing#1429 )
taqtiqa-mark
pushed a commit
to subversive-upstream/polkadot-sdk-substrate-frame-uniques
that referenced
this issue
Sep 14, 2023
Remove unneeded dependencies and dev-dependencies. Made self_destruct test not dependent on wasm bin size. Updated code related to deprecated warning on tracing-subscriber `scope()` ( See tokio-rs/tracing#1429 )
taqtiqa-mark
pushed a commit
to subversive-upstream/polkadot-sdk-substrate-frame-vesting
that referenced
this issue
Sep 14, 2023
Remove unneeded dependencies and dev-dependencies. Made self_destruct test not dependent on wasm bin size. Updated code related to deprecated warning on tracing-subscriber `scope()` ( See tokio-rs/tracing#1429 )
taqtiqa-mark
pushed a commit
to subversive-upstream/polkadot-sdk-substrate-frame-support
that referenced
this issue
Sep 14, 2023
Remove unneeded dependencies and dev-dependencies. Made self_destruct test not dependent on wasm bin size. Updated code related to deprecated warning on tracing-subscriber `scope()` ( See tokio-rs/tracing#1429 )
kaffarell
pushed a commit
to kaffarell/tracing
that referenced
this issue
May 22, 2024
## Motivation Fixes tokio-rs#1429 ## Solution Implemented as described in tokio-rs#1429, and migrated all internal uses of the deprecated methods. All tests passed both before and after the migration (9ec8130). - Add a new method `SpanRef::scope(&self)` that returns a leaf-to-root `Iterator`, including the specified leaf - Add a new method `Scope::from_root(self)` (where `Scope` is the type returned by `SpanRef::scope` defined earlier) that returns a root-to-leaf `Iterator` that ends at the current leaf (in other words: it's essentially the same as `Scope::collect::<Vec<_>>().into_iter().rev()`) - Deprecate all existing iterators, since they can be replaced by the new unified mechanism: - `Span::parents` is equivalent to `Span::scope().skip(1)` (although the `skip` is typically a bug) - `Span::from_root` is equivalent to `Span::scope().skip(1).from_root()` (although the `skip` is typically a bug) - `Context::scope` is equivalent to `Context::lookup_current().scope().from_root()` (although the `lookup_current` is sometimes a bug, see also tokio-rs#1428)
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Feature Request
Crates
tracing-subscriber
Motivation
Currently there are a way to traverse spans, that all behave subtly differently:
Context::scope
: implicit leaf span (based on the active span), ordered root-to-leaf, includes leaf spanSpan::from_root
: explicit leaf span, ordered root-to-leaf, excludes leaf spanSpan::parents
: explicit leaf span, ordered leaf-to-root, excludes leaf spanwhile let
iteration onSpan::parent
: explicit leaf span, ordered leaf-to-root, includes leaf span, not anIterator
All of these are problematic in different ways:
Layer::on_event
, and other cases where the currentSpan
may not match what you're trying to format (see also: Look up span for event #1428)Based on a Discord discussion starting at https://canary.discord.com/channels/500028886025895936/627649734592561152/852143116244221973
Proposal
SpanRef::scope(&self)
that returns a leaf-to-rootIterator
, including the specified leafScope::from_root(self)
(whereScope
is the type returned bySpanRef::scope
defined earlier) that returns a root-to-leafIterator
that ends at the current leaf (in other words: it's essentially the same asScope::collect::<Vec<_>>().into_iter().rev()
)Span::parents
is equivalent toSpan::scope().skip(1)
(although theskip
is typically a bug)Span::from_root
is equivalent toSpan::scope().skip(1).from_root()
(although theskip
is typically a bug)Context::scope
is equivalent toContext::lookup_current().scope().from_root()
(although thelookup_current
is sometimes a bug, see also Look up span for event #1428)Alternatives
Context::event_scope(&self, event: &Event)
(to handle the same use-case as Look up span for event #1428)SpanRef::scope
reify the list immediatelyThe text was updated successfully, but these errors were encountered: