Plan request tracing implementation

This commit is contained in:
Bojan Serafimov
2022-09-09 00:46:13 -04:00
parent 0b76b82e0e
commit abb07df028
2 changed files with 4 additions and 0 deletions

View File

@@ -472,6 +472,7 @@ impl PageServerHandler {
let tenant_id = tenant_id.to_string();
let timeline_id = timeline_id.to_string();
// TODO(now) append to trace if tenant is configured for read tracing
let response = match zenith_fe_msg {
PagestreamFeMessage::Exists(req) => SMGR_QUERY_TIME
.with_label_values(&["get_rel_exists", &tenant_id, &timeline_id])
@@ -854,6 +855,8 @@ impl postgres_backend::Handler for PageServerHandler {
self.check_permission(Some(tenantid))?;
// TODO(now) make trace logger if tenant is configured for read tracing.
// Also flush trace logger on drop.
self.handle_pagerequests(pgb, timelineid, tenantid)?;
} else if query_string.starts_with("basebackup ") {
let (_, params_raw) = query_string.split_at("basebackup ".len());

View File

@@ -87,6 +87,7 @@ pub struct TenantConf {
/// A lagging safekeeper will be changed after `lagging_wal_timeout` time elapses since the last WAL update,
/// to avoid eager reconnects.
pub max_lsn_wal_lag: NonZeroU64,
// TODO(now) add setting to enable read request tracing
}
/// Same as TenantConf, but this struct preserves the information about