log the proxy-credential, cache-miss and users-file passes at info, with counts in the message
This commit is contained in:
parent
5e997ebe2e
commit
22522b386a
3 changed files with 15 additions and 6 deletions
|
|
@ -214,19 +214,19 @@ where
|
||||||
let list = render_unrestricted(&users);
|
let list = render_unrestricted(&users);
|
||||||
if write_if_changed(files.unrestricted, &list)? {
|
if write_if_changed(files.unrestricted, &list)? {
|
||||||
tracing::info!(
|
tracing::info!(
|
||||||
unrestricted = list.lines().count(),
|
|
||||||
file = %files.unrestricted.display(),
|
file = %files.unrestricted.display(),
|
||||||
"squid users: wrote the unrestricted list"
|
"squid users: wrote the unrestricted list, {} unrestricted",
|
||||||
|
list.lines().count()
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
let current = read_or_empty(files.users)?;
|
let current = read_or_empty(files.users)?;
|
||||||
let rendered = render(¤t, &users)?;
|
let rendered = render(¤t, &users)?;
|
||||||
if write_if_changed(files.users, &rendered)? {
|
if write_if_changed(files.users, &rendered)? {
|
||||||
tracing::info!(
|
tracing::info!(
|
||||||
users = users.len(),
|
|
||||||
agents = users.iter().filter(|u| !is_selfcheck(&u.name)).count(),
|
|
||||||
file = %files.users.display(),
|
file = %files.users.display(),
|
||||||
"squid users: wrote the users file"
|
"squid users: wrote the users file, {} users for {} agents",
|
||||||
|
users.len(),
|
||||||
|
users.iter().filter(|u| !is_selfcheck(&u.name)).count()
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
Ok(())
|
Ok(())
|
||||||
|
|
|
||||||
|
|
@ -477,6 +477,7 @@ pub fn spawn(
|
||||||
) {
|
) {
|
||||||
tokio::spawn(async move {
|
tokio::spawn(async move {
|
||||||
let metrics = Metrics::global();
|
let metrics = Metrics::global();
|
||||||
|
tracing::info!("cache miss: pass every {}m", PASS_INTERVAL.as_secs() / 60);
|
||||||
let mut backoff = Backoff::default();
|
let mut backoff = Backoff::default();
|
||||||
let mut ticker =
|
let mut ticker =
|
||||||
tokio::time::interval_at(tokio::time::Instant::now() + PASS_INTERVAL, PASS_INTERVAL);
|
tokio::time::interval_at(tokio::time::Instant::now() + PASS_INTERVAL, PASS_INTERVAL);
|
||||||
|
|
@ -495,7 +496,10 @@ pub fn spawn(
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
match pass(&world, &mut backoff, &metrics, Instant::now()).await {
|
match pass(&world, &mut backoff, &metrics, Instant::now()).await {
|
||||||
Ok(sent) => tracing::debug!(rebuilds = sent.len(), "cache miss: pass done"),
|
Ok(sent) if !sent.is_empty() => {
|
||||||
|
tracing::info!("cache miss: pass sent {} rebuilds", sent.len());
|
||||||
|
}
|
||||||
|
Ok(_) => tracing::debug!("cache miss: pass done, no misses"),
|
||||||
Err(e) => tracing::warn!(error = %format!("{e:#}"), "cache miss: pass failed"),
|
Err(e) => tracing::warn!(error = %format!("{e:#}"), "cache miss: pass failed"),
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -158,6 +158,11 @@ pub fn spawn(hives: Vec<String>) {
|
||||||
anyhow::Ok((agents.len(), mint_missing(&store, &agents, &hives).await))
|
anyhow::Ok((agents.len(), mint_missing(&store, &agents, &hives).await))
|
||||||
};
|
};
|
||||||
match pass.await {
|
match pass.await {
|
||||||
|
Ok((agents, minted)) if minted > 0 => {
|
||||||
|
tracing::info!(
|
||||||
|
"proxy credentials: minted {minted} (agents and hive self-checks); {agents} agents hold a store identity"
|
||||||
|
);
|
||||||
|
}
|
||||||
Ok((agents, minted)) => {
|
Ok((agents, minted)) => {
|
||||||
tracing::debug!(agents, minted, "proxy credentials: pass done");
|
tracing::debug!(agents, minted, "proxy credentials: pass done");
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue