diff --git a/Cargo.lock b/Cargo.lock index 73eef56..1409065 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -933,7 +933,7 @@ dependencies = [ "once_cell", "page_size", "paste", - "prometheus", + "prometheus 0.13.4", "rand", "rust-embed", "seccompiler", @@ -974,7 +974,7 @@ dependencies = [ "log", "once_cell", "page_size", - "prometheus", + "prometheus 0.14.0", "strum", "toml", "tracing", @@ -1614,16 +1614,51 @@ dependencies = [ "lazy_static", "memchr", "parking_lot", - "protobuf", + "protobuf 2.28.0", "thiserror 1.0.69", ] +[[package]] +name = "prometheus" +version = "0.14.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3ca5326d8d0b950a9acd87e6a3f94745394f62e4dae1b1ee22b2bc0c394af43a" +dependencies = [ + "cfg-if", + "fnv", + "lazy_static", + "memchr", + "parking_lot", + "protobuf 3.7.2", + "thiserror 2.0.12", +] + [[package]] name = "protobuf" version = "2.28.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "106dd99e98437432fed6519dedecfade6a06a73bb7b2a1e019fdd2bee5778d94" +[[package]] +name = "protobuf" +version = "3.7.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d65a1d4ddae7d8b5de68153b48f6aa3bba8cb002b243dbdbc55a5afbc98f99f4" +dependencies = [ + "once_cell", + "protobuf-support", + "thiserror 1.0.69", +] + +[[package]] +name = "protobuf-support" +version = "3.7.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3e36c2f31e0a47f9280fb347ef5e461ffcd2c52dd520d8e216b52f93b0b0d7d6" +dependencies = [ + "thiserror 1.0.69", +] + [[package]] name = "psm" version = "0.1.24" diff --git a/src/hyperlight_wasm/Cargo.toml b/src/hyperlight_wasm/Cargo.toml index 43de16b..ca0c84e 100644 --- a/src/hyperlight_wasm/Cargo.toml +++ b/src/hyperlight_wasm/Cargo.toml @@ -49,7 +49,7 @@ page_size = "0.6.0" examples_common = { path = "../examples_common" } criterion = { version = "0.5.1", features = ["html_reports"] } lazy_static = "1.4.0" -prometheus = "0.13.3" +prometheus = "0.14.0" crossbeam-queue = "0.3" blake3 = "1.8" toml = "0.8.19" diff --git a/src/hyperlight_wasm/examples/metrics/main.rs b/src/hyperlight_wasm/examples/metrics/main.rs index 361013b..e3ffe00 100644 --- a/src/hyperlight_wasm/examples/metrics/main.rs +++ b/src/hyperlight_wasm/examples/metrics/main.rs @@ -141,38 +141,38 @@ fn get_metrics() { for metric in metrics.iter() { match metric.get_field_type() { prometheus::proto::MetricType::COUNTER => { - println!("Counter: {:?}", metric.get_help()); + println!("Counter: {:?}", metric.help()); metric.get_metric().iter().for_each(|metric| { let pair = metric.get_label(); for pair in pair.iter() { - println!("Label: {:?} Name: {:?}", pair.get_name(), pair.get_value()); + println!("Label: {:?} Name: {:?}", pair.name(), pair.value()); } - println!("Value: {:?}", metric.get_counter().get_value()); + println!("Value: {:?}", metric.get_counter().value()); }); } prometheus::proto::MetricType::GAUGE => { - println!("Gauge: {:?}", metric.get_help()); + println!("Gauge: {:?}", metric.help()); metric.get_metric().iter().for_each(|metric| { let pair = metric.get_label(); for pair in pair.iter() { - println!("Label: {:?} Name: {:?}", pair.get_name(), pair.get_value()); + println!("Label: {:?} Name: {:?}", pair.name(), pair.value()); } - println!("Value: {:?}", metric.get_gauge().get_value()); + println!("Value: {:?}", metric.get_gauge().value()); }); } prometheus::proto::MetricType::UNTYPED => { - println!("Metric: {:?}", metric.get_help()); + println!("Metric: {:?}", metric.help()); } prometheus::proto::MetricType::HISTOGRAM => { - println!("Histogram: {:?}", metric.get_help()); + println!("Histogram: {:?}", metric.help()); for metric in metric.get_metric() { let pair = metric.get_label(); for pair in pair.iter() { - println!("Label: {:?} Name: {:?}", pair.get_name(), pair.get_value()); + println!("Label: {:?} Name: {:?}", pair.name(), pair.value()); } - let count = metric.get_histogram().get_sample_count(); + let count = metric.get_histogram().sample_count(); println!("Number of observations: {:?}", count); - let sm = metric.get_histogram().get_sample_sum(); + let sm = metric.get_histogram().sample_sum(); println!("Sum of observations: {:?}", sm); metric .get_histogram() @@ -181,14 +181,14 @@ fn get_metrics() { .for_each(|bucket| { println!( "Bucket: {:?} Count: {:?}", - bucket.get_upper_bound(), - bucket.get_cumulative_count() + bucket.upper_bound(), + bucket.cumulative_count() ) }); } } prometheus::proto::MetricType::SUMMARY => { - println!("Summary: {:?}", metric.get_help()); + println!("Summary: {:?}", metric.help()); } } }