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

feat(subscriber): Reduce default retention to six seconds #504

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
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
15 changes: 8 additions & 7 deletions console-subscriber/src/lib.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,4 @@
#![doc = include_str!("../README.md")]
use console_api as proto;
use proto::{instrument::instrument_server::InstrumentServer, resources::resource};
use serde::Serialize;
use std::{
cell::RefCell,
fmt,
Expand All @@ -12,6 +9,10 @@ use std::{
},
time::{Duration, Instant},
};

use console_api as proto;
use proto::{instrument::instrument_server::InstrumentServer, resources::resource};
use serde::Serialize;
use thread_local::ThreadLocal;
#[cfg(unix)]
use tokio::net::UnixListener;
Expand Down Expand Up @@ -43,14 +44,13 @@ pub(crate) mod sync;
mod visitors;

pub use aggregator::Aggregator;
pub use builder::{init, spawn};
pub use builder::{Builder, ServerAddr};
use callsites::Callsites;
use record::Recorder;
use stack::SpanStack;
use visitors::{AsyncOpVisitor, ResourceVisitor, ResourceVisitorResult, TaskVisitor, WakerVisitor};

pub use builder::{init, spawn};

use crate::visitors::{PollOpVisitor, StateUpdateVisitor};

/// A [`ConsoleLayer`] is a [`tracing_subscriber::Layer`] that records [`tracing`]
Expand Down Expand Up @@ -355,7 +355,8 @@ impl ConsoleLayer {
/// [environment variable]: `Builder::with_default_env`
pub const DEFAULT_PUBLISH_INTERVAL: Duration = Duration::from_secs(1);

/// By default, completed spans are retained for one hour.
/// By default, completed spans are retained for six seconds, which
/// matches tokio-console's `retain_for` display period.
///
/// Note that methods like [`init`][`crate::init`] and
/// [`spawn`][`crate::spawn`] will take the value from the
Expand All @@ -365,7 +366,7 @@ impl ConsoleLayer {
/// See also [`Builder::retention`].
///
/// [environment variable]: `Builder::with_default_env`
pub const DEFAULT_RETENTION: Duration = Duration::from_secs(60 * 60);
pub const DEFAULT_RETENTION: Duration = Duration::from_secs(6);

/// The default maximum value for task poll duration histograms.
///
Expand Down