Skip to content
Merged
Show file tree
Hide file tree
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
6 changes: 3 additions & 3 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion src/adapter/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ mz-transform = { path = "../transform" }
mz-timestamp-oracle = { path = "../timestamp-oracle" }
openssl = { version = "0.10.73", features = ["vendored"] }
opentelemetry = { version = "0.24.0", features = ["trace"] }
prometheus = { version = "0.13.4", default-features = false }
prometheus = { version = "0.14.0", default-features = false }
prost = { version = "0.13.5", features = ["no-recursion-limit"] }
qcell = "0.5"
rand = "0.8.5"
Expand Down
2 changes: 1 addition & 1 deletion src/adapter/src/client.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1211,7 +1211,7 @@ impl RecordFirstRowStream {
.inner()
.metrics()
.time_to_first_row_seconds
.with_label_values(&[&instance, isolation_level.as_str(), strategy])
.with_label_values(&[instance.as_ref(), isolation_level.as_str(), strategy])
}

/// If you want to match [`RecordFirstRowStream`]'s logic but don't need
Expand Down
6 changes: 2 additions & 4 deletions src/adapter/src/coord.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3302,7 +3302,7 @@ impl Coordinator {
}));

let (idle_tx, mut idle_rx) = tokio::sync::mpsc::channel(1);
let idle_metric = self.metrics.queue_busy_seconds.with_label_values(&[]);
let idle_metric = self.metrics.queue_busy_seconds.clone();
let last_message_watchdog = Arc::clone(&last_message);

spawn(|| "coord watchdog", async move {
Expand Down Expand Up @@ -3371,9 +3371,7 @@ impl Coordinator {
let mut messages = Vec::with_capacity(MESSAGE_BATCH);
let mut cmd_messages = Vec::with_capacity(MESSAGE_BATCH);

let message_batch = self.metrics
.message_batch
.with_label_values(&[]);
let message_batch = self.metrics.message_batch.clone();

loop {
// Before adding a branch to this select loop, please ensure that the branch is
Expand Down
5 changes: 1 addition & 4 deletions src/adapter/src/coord/appends.rs
Original file line number Diff line number Diff line change
Expand Up @@ -554,10 +554,7 @@ impl Coordinator {
);
}
// Instrument our table writes since they can block the coordinator.
let histogram = self
.metrics
.append_table_duration_seconds
.with_label_values(&[]);
let histogram = self.metrics.append_table_duration_seconds.clone();
let append_fut = self
.controller
.storage
Expand Down
5 changes: 1 addition & 4 deletions src/adapter/src/coord/message_handler.rs
Original file line number Diff line number Diff line change
Expand Up @@ -220,10 +220,7 @@ impl Coordinator {
.map(|(_id, m)| m.data_shard)
.collect();

let collection_metric = self
.metrics
.storage_usage_collection_time_seconds
.with_label_values(&[]);
let collection_metric = self.metrics.storage_usage_collection_time_seconds.clone();

// Spawn an asynchronous task to compute the storage usage, which
// requires a slow scan of the underlying storage engine.
Expand Down
1 change: 0 additions & 1 deletion src/adapter/src/coord/peek.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1099,7 +1099,6 @@ impl crate::coord::Coordinator {
if let Some(uuids) = self.client_pending_peeks.remove(conn_id) {
self.metrics
.canceled_peeks
.with_label_values(&[])
.inc_by(u64::cast_from(uuids.len()));

let mut inverse: BTreeMap<ComputeInstanceId, BTreeSet<Uuid>> = Default::default();
Expand Down
2 changes: 0 additions & 2 deletions src/adapter/src/coord/statement_logging.rs
Original file line number Diff line number Diff line change
Expand Up @@ -716,12 +716,10 @@ impl Coordinator {
if !*accounted {
self.metrics
.statement_logging_unsampled_bytes
.with_label_values(&[])
.inc_by(u64::cast_from(sql.len()));
if sample {
self.metrics
.statement_logging_actual_bytes
.with_label_values(&[])
.inc_by(u64::cast_from(sql.len()));
}
*accounted = true;
Expand Down
2 changes: 1 addition & 1 deletion src/adapter/src/coord/timestamp_selection.rs
Original file line number Diff line number Diff line change
Expand Up @@ -911,7 +911,7 @@ impl Coordinator {
self.metrics
.timestamp_difference_for_strict_serializable_ms
.with_label_values(&[
&compute_instance.to_string(),
compute_instance.to_string().as_ref(),
constraint_based.as_str(),
])
.observe(f64::cast_lossy(u64::from(
Expand Down
26 changes: 12 additions & 14 deletions src/adapter/src/metrics.rs
Original file line number Diff line number Diff line change
Expand Up @@ -21,29 +21,29 @@ pub struct Metrics {
pub active_sessions: IntGaugeVec,
pub active_subscribes: IntGaugeVec,
pub active_copy_tos: IntGaugeVec,
pub queue_busy_seconds: HistogramVec,
pub queue_busy_seconds: Histogram,
pub determine_timestamp: IntCounterVec,
pub timestamp_difference_for_strict_serializable_ms: HistogramVec,
pub commands: IntCounterVec,
pub storage_usage_collection_time_seconds: HistogramVec,
pub storage_usage_collection_time_seconds: Histogram,
pub subscribe_outputs: IntCounterVec,
pub canceled_peeks: IntCounterVec,
pub canceled_peeks: IntCounter,
pub linearize_message_seconds: HistogramVec,
pub time_to_first_row_seconds: HistogramVec,
pub statement_logging_records: IntCounterVec,
pub statement_logging_unsampled_bytes: IntCounterVec,
pub statement_logging_actual_bytes: IntCounterVec,
pub message_batch: HistogramVec,
pub statement_logging_unsampled_bytes: IntCounter,
pub statement_logging_actual_bytes: IntCounter,
pub message_batch: Histogram,
pub message_handling: HistogramVec,
pub optimization_notices: IntCounterVec,
pub append_table_duration_seconds: HistogramVec,
pub append_table_duration_seconds: Histogram,
pub webhook_validation_reduce_failures: IntCounterVec,
pub webhook_get_appender: IntCounter,
pub check_scheduling_policies_seconds: HistogramVec,
pub handle_scheduling_decisions_seconds: HistogramVec,
pub row_set_finishing_seconds: HistogramVec,
pub session_startup_table_writes_seconds: HistogramVec,
pub parse_seconds: HistogramVec,
pub row_set_finishing_seconds: Histogram,
pub session_startup_table_writes_seconds: Histogram,
pub parse_seconds: Histogram,
pub pgwire_message_processing_seconds: HistogramVec,
pub result_rows_first_to_last_byte_seconds: HistogramVec,
pub pgwire_ensure_transaction_seconds: HistogramVec,
Expand Down Expand Up @@ -225,15 +225,13 @@ impl Metrics {
}

pub(crate) fn row_set_finishing_seconds(&self) -> Histogram {
self.row_set_finishing_seconds.with_label_values(&[])
self.row_set_finishing_seconds.clone()
}

pub(crate) fn session_metrics(&self) -> SessionMetrics {
SessionMetrics {
row_set_finishing_seconds: self.row_set_finishing_seconds(),
session_startup_table_writes_seconds: self
.session_startup_table_writes_seconds
.with_label_values(&[]),
session_startup_table_writes_seconds: self.session_startup_table_writes_seconds.clone(),
}
}
}
Expand Down
2 changes: 1 addition & 1 deletion src/balancerd/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ mz-tracing = { path = "../tracing" }
mz-pgwire-common = { path = "../pgwire-common" }
num_cpus = "1.17.0"
openssl = { version = "0.10.73", features = ["vendored"] }
prometheus = { version = "0.13.4", default-features = false }
prometheus = { version = "0.14.0", default-features = false }
proxy-header = "0.1.2"
semver = "1.0.27"
tokio = { version = "1.44.1", default-features = false }
Expand Down
2 changes: 1 addition & 1 deletion src/catalog/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ mz-storage-types = { path = "../storage-types" }
mz-transform = { path = "../transform" }
openssl = { version = "0.10.73", features = ["vendored"] }
paste = "1.0.11"
prometheus = { version = "0.13.4", default-features = false }
prometheus = { version = "0.14.0", default-features = false }
proptest = { version = "1.7.0", default-features = false, features = ["std"] }
proptest-derive = { version = "0.5.1", features = ["boxed_union"] }
prost = "0.13.5"
Expand Down
2 changes: 1 addition & 1 deletion src/cluster-client/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ workspace = true
anyhow = "1.0.100"
mz-ore = { path = "../ore", features = ["tracing"] }
mz-repr = { path = "../repr" }
prometheus = { version = "0.13.4", default-features = false }
prometheus = { version = "0.14.0", default-features = false }
serde = { version = "1.0.219", features = ["derive"] }
serde_json = "1.0.145"
uuid = "1.18.1"
Expand Down
2 changes: 1 addition & 1 deletion src/compute-client/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ mz-service = { path = "../service" }
mz-storage-client = { path = "../storage-client" }
mz-storage-types = { path = "../storage-types" }
mz-tracing = { path = "../tracing" }
prometheus = { version = "0.13.4", default-features = false }
prometheus = { version = "0.14.0", default-features = false }
serde = { version = "1.0.219", features = ["derive"] }
serde_json = "1.0.145"
thiserror = "2.0.17"
Expand Down
4 changes: 2 additions & 2 deletions src/compute-client/src/controller.rs
Original file line number Diff line number Diff line change
Expand Up @@ -264,9 +264,9 @@ impl<T: ComputeControllerTimestamp> ComputeController<T> {
for metric in metrics {
'metric: for metric in metric.mut_metric() {
for label in metric.get_label() {
if label.get_name() == "instance_id" {
if label.name() == "instance_id" {
if let Some(workload_class) = instance_workload_classes
.get(label.get_value())
.get(label.value())
.cloned()
.flatten()
{
Expand Down
2 changes: 1 addition & 1 deletion src/compute/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ mz-storage-operators = { path = "../storage-operators" }
mz-storage-types = { path = "../storage-types" }
mz-timely-util = { path = "../timely-util" }
mz-txn-wal = { path = "../txn-wal" }
prometheus = { version = "0.13.4", default-features = false }
prometheus = { version = "0.14.0", default-features = false }
scopeguard = "1.2.0"
serde = { version = "1.0.219", features = ["derive"] }
smallvec = { version = "1.15.1", features = ["serde", "union"] }
Expand Down
18 changes: 9 additions & 9 deletions src/compute/src/metrics.rs
Original file line number Diff line number Diff line change
Expand Up @@ -200,7 +200,7 @@ impl ComputeMetrics {
let stashed_peek_seconds = self.stashed_peek_seconds.with_label_values(&[&worker]);
let handle_command_duration_seconds = CommandMetrics::build(|typ| {
self.handle_command_duration_seconds
.with_label_values(&[&worker, typ])
.with_label_values(&[worker.as_ref(), typ])
});
let replica_expiration_timestamp_seconds = self
.replica_expiration_timestamp_seconds
Expand Down Expand Up @@ -263,7 +263,7 @@ impl WorkerMetrics {
let command_counts = CommandMetrics::build(|typ| {
self.metrics
.history_command_count
.with_label_values(&[&self.worker_label, typ])
.with_label_values(&[self.worker_label.as_ref(), typ])
});
let dataflow_count = self
.metrics
Expand Down Expand Up @@ -300,27 +300,27 @@ impl WorkerMetrics {
if !compatible {
self.metrics
.reconciliation_replaced_dataflows_count_total
.with_label_values(&[&self.worker_label, "incompatible"])
.with_label_values(&[self.worker_label.as_ref(), "incompatible"])
.inc();
} else if !uncompacted {
self.metrics
.reconciliation_replaced_dataflows_count_total
.with_label_values(&[&self.worker_label, "compacted"])
.with_label_values(&[self.worker_label.as_ref(), "compacted"])
.inc();
} else if !subscribe_free {
self.metrics
.reconciliation_replaced_dataflows_count_total
.with_label_values(&[&self.worker_label, "subscribe"])
.with_label_values(&[self.worker_label.as_ref(), "subscribe"])
.inc();
} else if !copy_to_free {
self.metrics
.reconciliation_replaced_dataflows_count_total
.with_label_values(&[&self.worker_label, "copy-to"])
.with_label_values(&[self.worker_label.as_ref(), "copy-to"])
.inc();
} else if !dependencies_retained {
self.metrics
.reconciliation_replaced_dataflows_count_total
.with_label_values(&[&self.worker_label, "dependency"])
.with_label_values(&[self.worker_label.as_ref(), "dependency"])
.inc();
} else {
self.metrics
Expand All @@ -342,7 +342,7 @@ impl WorkerMetrics {
let hydrated = if hydrated { "1" } else { "0" };
self.metrics
.collection_count
.with_label_values(&[&self.worker_label, collection_type, hydrated])
.with_label_values(&[self.worker_label.as_ref(), collection_type, hydrated])
.inc();
}

Expand All @@ -351,7 +351,7 @@ impl WorkerMetrics {
let hydrated = if hydrated { "1" } else { "0" };
self.metrics
.collection_count
.with_label_values(&[&self.worker_label, collection_type, hydrated])
.with_label_values(&[self.worker_label.as_ref(), collection_type, hydrated])
.dec();
}

Expand Down
2 changes: 1 addition & 1 deletion src/durable-cache/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ mz-dyncfg = { path = "../dyncfg" }
mz-persist-types = { path = "../persist-types" }
mz-persist-client = { path = "../persist-client" }
mz-timely-util = { path = "../timely-util" }
prometheus = { version = "0.13.4", default-features = false }
prometheus = { version = "0.14.0", default-features = false }
prost = { version = "0.13.5", features = ["no-recursion-limit"] }
serde = { version = "1.0.219", features = ["derive", "rc"] }
timely = "0.24.0"
Expand Down
2 changes: 1 addition & 1 deletion src/environmentd/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ opentelemetry_sdk = { version = "0.24.1", features = ["rt-tokio"] }
pin-project = "1.1.10"
postgres = { version = "0.19.5", optional = true }
postgres-openssl = { version = "0.5.0", optional = true }
prometheus = { version = "0.13.4", default-features = false }
prometheus = { version = "0.14.0", default-features = false }
rdkafka-sys = { version = "4.3.0", features = [
"cmake-build",
"ssl-vendored",
Expand Down
18 changes: 9 additions & 9 deletions src/environmentd/src/http/metrics.rs
Original file line number Diff line number Diff line change
Expand Up @@ -164,13 +164,13 @@ where
let duration_metric = this
.metrics
.request_duration
.with_label_values(&[this.source, this.path]);
.with_label_values::<&str>(&[this.source, this.path]);
*this.timer = Some(duration_metric.start_timer());

// Increment our counter of currently active requests.
this.metrics
.requests_active
.with_label_values(&[this.source, this.path])
.with_label_values::<&str>(&[this.source, this.path])
.inc();
}

Expand All @@ -184,7 +184,7 @@ where
// Record the completion of this request.
this.metrics
.requests
.with_label_values(&[this.source, this.path, status.as_str()])
.with_label_values::<&str>(&[this.source, this.path, status.as_str()])
.inc();

// Record the duration of this request.
Expand All @@ -195,7 +195,7 @@ where
// We've completed this request, so decrement the count.
this.metrics
.requests_active
.with_label_values(&[this.source, this.path])
.with_label_values::<&str>(&[this.source, this.path])
.dec();

Poll::Ready(Ok(resp))
Expand All @@ -214,7 +214,7 @@ impl<F> PinnedDrop for PrometheusFuture<F> {
// Make sure to decrement the in-progress count if we weren't polled to completion.
this.metrics
.requests_active
.with_label_values(&[this.source, this.path])
.with_label_values::<&str>(&[this.source, this.path])
.dec();

// Our request didn't complete, so don't record the timing.
Expand Down Expand Up @@ -252,14 +252,14 @@ mod test {
// We don't log total requests until the request completes.
let total_requests_exists = metrics
.iter()
.find(|metric| metric.get_name().contains("requests_total"))
.find(|metric| metric.name().contains("requests_total"))
.is_some();
assert!(!total_requests_exists);

// We should have one request in-flight.
let active_requests = metrics
.iter()
.find(|metric| metric.get_name().contains("requests_active"))
.find(|metric| metric.name().contains("requests_active"))
.unwrap();
assert_eq!(active_requests.get_metric()[0].get_gauge().get_value(), 1.0);

Expand All @@ -271,14 +271,14 @@ mod test {
// Our in-flight request count should have been decremented.
let active_requests = metrics
.iter()
.find(|metric| metric.get_name().contains("requests_active"))
.find(|metric| metric.name().contains("requests_active"))
.unwrap();
assert_eq!(active_requests.get_metric()[0].get_gauge().get_value(), 0.0);

// We should have discarded the in-flight timer.
let active_requests = metrics
.iter()
.find(|metric| metric.get_name().contains("request_duration_seconds"))
.find(|metric| metric.name().contains("request_duration_seconds"))
.unwrap();
assert_eq!(
active_requests.get_metric()[0]
Expand Down
Loading