try: enclose load operations to initial load span

this makes only sense if we would then have a "new span" start after
tenants and timelines have been activated, not doing that now.
This commit is contained in:
Joonas Koivunen
2023-05-31 15:34:56 +03:00
parent 2725f6197f
commit 677f46301f
2 changed files with 16 additions and 8 deletions

View File

@@ -342,16 +342,24 @@ fn start_pageserver(
let (init_done_tx, init_done_rx) = utils::completion::channel();
// Scan the local 'tenants/' directory and start loading the tenants
let span = tracing::info_span!("initial load");
let init_started_at = std::time::Instant::now();
BACKGROUND_RUNTIME.block_on(mgr::init_tenant_mgr(
conf,
broker_client.clone(),
remote_storage.clone(),
(init_done_tx, init_done_rx.clone()),
))?;
// initial load started by initializing tenant manager but stopped when initialization is
// actually complete
BACKGROUND_RUNTIME.block_on(
mgr::init_tenant_mgr(
conf,
broker_client.clone(),
remote_storage.clone(),
(init_done_tx, init_done_rx.clone()),
)
.instrument(span.clone()),
)?;
BACKGROUND_RUNTIME.spawn({
let init_done_rx = init_done_rx.clone();
async move {
init_done_rx.wait().await;
@@ -362,6 +370,7 @@ fn start_pageserver(
"Initial load completed."
);
}
.instrument(span)
});
// shared state between the disk-usage backed eviction background task and the http endpoint

View File

@@ -955,8 +955,7 @@ impl Tenant {
Ok(())
}
.instrument({
let span = tracing::info_span!(parent: None, "load", tenant_id=%tenant_id);
span.follows_from(Span::current());
let span = tracing::info_span!("load", tenant_id=%tenant_id);
span
}),
);