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

subscriber: Implement FollowsFrom #431

Open
davidbarsky opened this issue Nov 14, 2019 · 0 comments
Open

subscriber: Implement FollowsFrom #431

davidbarsky opened this issue Nov 14, 2019 · 0 comments
Labels
crate/subscriber Related to the `tracing-subscriber` crate kind/feature New feature or request

Comments

@davidbarsky
Copy link
Member

(This is followup from #420)

The Registry and fmt::Layer should record all the spans that a given span succeeds. This data will need to be added to DataInner:

struct DataInner {
metadata: &'static Metadata<'static>,
parent: Option<Id>,
ref_count: AtomicUsize,
pub(crate) extensions: RwLock<ExtensionsInner>,
}

and exposed via the SpanData trait:

pub trait SpanData<'a> {
/// Returns this span's ID.
fn id(&self) -> Id;
/// Returns a reference to the span's `Metadata`.
fn metadata(&self) -> &'static Metadata<'static>;
/// Returns a reference to the ID
fn parent(&self) -> Option<&Id>;
/// Returns a reference to this span's `Extensions`.
///
/// The extensions may be used by `Layer`s to store additional data
/// describing the span.
fn extensions(&self) -> Extensions<'_>;
/// Returns a mutable reference to this span's `Extensions`.
///
/// The extensions may be used by `Layer`s to store additional data
/// describing the span.
fn extensions_mut(&self) -> ExtensionsMut<'_>;
}

Note that FollowsFrom is a singly-linked graph, so that FollowsFrom relationship will need to be stored as a Vec<Id> on DataInner.

@davidbarsky davidbarsky added kind/feature New feature or request crate/subscriber Related to the `tracing-subscriber` crate labels Nov 14, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
crate/subscriber Related to the `tracing-subscriber` crate kind/feature New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant