diff --git a/Cargo.lock b/Cargo.lock index d738964..4391398 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -124,15 +124,6 @@ version = "0.22.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "72b3254f16251a8381aa12e40e3c4d2f0199f8c6508fbecb9d91f575e0fbb8c6" -[[package]] -name = "bincode" -version = "1.3.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b1f45e9417d87227c7a56d22e471c6206462cba514c7590c09aff4cf6d1ddcad" -dependencies = [ - "serde", -] - [[package]] name = "bindgen" version = "0.68.1" @@ -199,7 +190,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "dbe5b10e214954177fb1dc9fbd20a1a2608fe99e6c832033bdc7cea287a20d77" dependencies = [ "borsh-derive", - "cfg_aliases", + "cfg_aliases 0.1.1", ] [[package]] @@ -318,6 +309,12 @@ version = "0.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "fd16c4719339c4530435d38e511904438d07cce7950afa3718a84ac36c10e89e" +[[package]] +name = "cfg_aliases" +version = "0.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "613afe47fcd5fac7ccf1db93babcb082c5994d996f20b8b159f2ad1658eb5724" + [[package]] name = "chrono" version = "0.4.38" @@ -354,15 +351,6 @@ dependencies = [ "libloading", ] -[[package]] -name = "convert_case" -version = "0.6.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ec182b0ca2f35d8fc196cf3404988fd8b8c739a4d270ff118a398feb0cbec1ca" -dependencies = [ - "unicode-segmentation", -] - [[package]] name = "core-foundation" version = "0.9.3" @@ -488,7 +476,7 @@ version = "0.6.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "5ffccbb6966c05b32ef8fbac435df276c4ae4d3dc55a8cd0eb9745e6c12f546a" dependencies = [ - "heck", + "heck 0.4.1", "proc-macro2", "quote", "syn 2.0.65", @@ -688,6 +676,12 @@ version = "0.4.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "95505c38b4572b2d910cecb0281560f54b440a19336cbbcb27bf6ce6adc6f5a8" +[[package]] +name = "heck" +version = "0.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2304e00983f87ffb38b55b444b5e3b60a884b5d30c0fca7d82fe33449bbe55ea" + [[package]] name = "hermit-abi" version = "0.3.9" @@ -848,9 +842,9 @@ dependencies = [ [[package]] name = "indexmap" -version = "2.2.6" +version = "2.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "168fb715dda47215e360912c096649d23d58bf392ac62f73919e831745e40f26" +checksum = "68b900aa2f7301e21c36462b170ee99994de34dff39a4a6a528e80e7376d07e5" dependencies = [ "equivalent", "hashbrown 0.14.1", @@ -889,9 +883,9 @@ checksum = "7655c9839580ee829dfacba1d1278c2b7883e50a277ff7541299489d6bdfdc45" [[package]] name = "itertools" -version = "0.12.1" +version = "0.13.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ba291022dbbd398a455acf126c1e341954079855bc60dfdda641363bd6922569" +checksum = "413ee7dfc52ee1a4949ceeb7dbc8a33f2d6c088194d9f922fb8318faf1f01186" dependencies = [ "either", ] @@ -1086,13 +1080,13 @@ dependencies = [ [[package]] name = "nix" -version = "0.28.0" +version = "0.29.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ab2156c4fce2f8df6c499cc1c763e4394b7482525bf2a9701c9d79d215f519e4" +checksum = "71e2746dc3a24dd78b3cfcb7be93368c6de9963d30f43a6a73998a9cf4b17b46" dependencies = [ "bitflags 2.4.0", "cfg-if", - "cfg_aliases", + "cfg_aliases 0.2.1", "libc", ] @@ -1126,11 +1120,11 @@ dependencies = [ [[package]] name = "nu-derive-value" -version = "0.96.1" +version = "0.98.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e9ef09247e4df05cabf3c66a65cb55b20bfa0f33914ba6fa07455e9e85dca665" +checksum = "1f2619f3ae9a21794cf4c49c2962c3e5274764d87a3e0d97587283796ae4b99a" dependencies = [ - "convert_case", + "heck 0.5.0", "proc-macro-error", "proc-macro2", "quote", @@ -1139,28 +1133,29 @@ dependencies = [ [[package]] name = "nu-engine" -version = "0.96.1" +version = "0.98.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "20979fe46ef1f348d8acb52160b518954a8fedc916e16e4d3eecce53a5f3d0c6" +checksum = "1fab89403670cb3048f531ff8ac8d9cdfd9ac72862f9031194756d82729f9d8e" dependencies = [ "log", "nu-glob", "nu-path", "nu-protocol", "nu-utils", + "terminal_size", ] [[package]] name = "nu-glob" -version = "0.96.1" +version = "0.98.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6f3c0919a20d015280032a67463d4fa672a98069aebd210bd9675bf7af2e9188" +checksum = "8f2367837197545cca98329358342d08498a5cfc0911d446debb35e3bbc5b44a" [[package]] name = "nu-path" -version = "0.96.1" +version = "0.98.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a08f652fe8d13050a5fd8e062398cd27f5b7a621cb882d884b2d47a29bf2b996" +checksum = "08fdfbc5a5f6f86b21b3035dc8043b09543ecf4d505010df99b35231abeb9d44" dependencies = [ "dirs", "omnipath", @@ -1169,9 +1164,9 @@ dependencies = [ [[package]] name = "nu-plugin" -version = "0.96.1" +version = "0.98.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7eeabdcb0222e7d14593af59907393f761ecca9043ae8afcc236c05d8dc8842c" +checksum = "b17233bbf5c41a478e35b8800c88cf9a53b9633346da138430a35ec8344ce7a6" dependencies = [ "log", "nix", @@ -1185,9 +1180,9 @@ dependencies = [ [[package]] name = "nu-plugin-core" -version = "0.96.1" +version = "0.98.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4314c53526a49ecace0d0ff826bb8d660eb5b1626b69e49e3215b595b0172bb3" +checksum = "738b28a0c4ff5a24666b67f2b5c1bbc6fdc5007149a19a1f490b4827b8fa67ae" dependencies = [ "interprocess", "log", @@ -1201,13 +1196,13 @@ dependencies = [ [[package]] name = "nu-plugin-protocol" -version = "0.96.1" +version = "0.98.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2966c373b5b5e6cd041d836bf3fdd9bd7f2e154c30976983bd920810a5d6672a" +checksum = "8971280787b5f77749c4738cfaf71b429f7b44715ebc88d22a0bb133ee61f41b" dependencies = [ - "bincode", "nu-protocol", "nu-utils", + "rmp-serde", "semver", "serde", "typetag", @@ -1215,18 +1210,19 @@ dependencies = [ [[package]] name = "nu-protocol" -version = "0.96.1" +version = "0.98.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2739f2d6b4d1449ca043813dc5121e9e760a385345cc270b2fb8c24bf5248ac4" +checksum = "22d2b192c6f44b22bf6fadebe8cb4c0450c5f3a1ef0760b10a8a34d86a408d37" dependencies = [ "brotli", "byte-unit", + "bytes", "chrono", "chrono-humanize", - "convert_case", "dirs", "dirs-sys", "fancy-regex", + "heck 0.5.0", "indexmap", "log", "lru", @@ -1247,9 +1243,9 @@ dependencies = [ [[package]] name = "nu-system" -version = "0.96.1" +version = "0.98.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1674bd95d60e0c69b037094cff6a34a67c2dc18c3c218ae6dee24aa9c0bf6627" +checksum = "08076dc19b3b6b51721e70296f6ee50af46badad86fdbb3149dd39660140115c" dependencies = [ "chrono", "itertools", @@ -1267,9 +1263,9 @@ dependencies = [ [[package]] name = "nu-utils" -version = "0.96.1" +version = "0.98.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e3ebdd83792b2d0fa2ea79d859083408af9c82c9a2f219c5506f78781f114569" +checksum = "e5d17bc14c181cb42fadbacfecbd2a4d68912dd24e49278e428e585b7b4ec7f3" dependencies = [ "crossterm_winapi", "log", @@ -2534,12 +2530,6 @@ dependencies = [ "tinyvec", ] -[[package]] -name = "unicode-segmentation" -version = "1.11.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d4c87d22b6e3f4a18d4d40ef354e97c90fcb14dd91d7dc0aa9d8a1172ebf7202" - [[package]] name = "unicode-width" version = "0.1.11" diff --git a/Cargo.toml b/Cargo.toml index a090f18..3170f4c 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -17,8 +17,8 @@ categories = ["command-line-utilities"] [dependencies] chrono = "0.4.38" nom = "7.1.3" -nu-plugin = "0.96.1" -nu-protocol = { version = "0.96.1", features = [ "plugin" ] } +nu-plugin = "0.98.0" +nu-protocol = { version = "0.98.0", features = [ "plugin" ] } prometheus-http-query = "0.8.3" reqwest = { version = "0.12.5", features = [ "native-tls" ] } tokio = { version ="1.40.0", features = [ "macros", "rt" ] } diff --git a/README.md b/README.md index dec22ac..6688698 100644 --- a/README.md +++ b/README.md @@ -3,7 +3,7 @@ A nushell plugin for querying prometheus Supports: -* nushell 0.96.1 +* nushell 0.98.0 * Prometheus API * Instant queries * Range queryies diff --git a/src/prometheus/label_names_command.rs b/src/prometheus/label_names_command.rs index 5919617..535a160 100644 --- a/src/prometheus/label_names_command.rs +++ b/src/prometheus/label_names_command.rs @@ -18,7 +18,7 @@ impl SimplePluginCommand for LabelNamesCommand { fn signature(&self) -> Signature { Signature::build(self.name()) - .usage(self.usage()) + .description(self.description()) .named( "start", SyntaxShape::DateTime, @@ -50,7 +50,7 @@ impl SimplePluginCommand for LabelNamesCommand { ]) } - fn usage(&self) -> &str { + fn description(&self) -> &str { "Query for label names" } diff --git a/src/prometheus/label_values_command.rs b/src/prometheus/label_values_command.rs index 91e325b..fd83179 100644 --- a/src/prometheus/label_values_command.rs +++ b/src/prometheus/label_values_command.rs @@ -18,7 +18,7 @@ impl SimplePluginCommand for LabelValuesCommand { fn signature(&self) -> Signature { Signature::build(self.name()) - .usage(self.usage()) + .description(self.description()) .named( "start", SyntaxShape::DateTime, @@ -55,7 +55,7 @@ impl SimplePluginCommand for LabelValuesCommand { ]) } - fn usage(&self) -> &str { + fn description(&self) -> &str { "Query for label values" } diff --git a/src/prometheus/metric_metadata_command.rs b/src/prometheus/metric_metadata_command.rs index 2b3679d..b6d0a7f 100644 --- a/src/prometheus/metric_metadata_command.rs +++ b/src/prometheus/metric_metadata_command.rs @@ -15,7 +15,7 @@ impl SimplePluginCommand for MetricMetadataCommand { fn signature(&self) -> nu_protocol::Signature { Signature::build(self.name()) - .usage(self.usage()) + .description(self.description()) .named( "source", SyntaxShape::String, @@ -46,7 +46,7 @@ impl SimplePluginCommand for MetricMetadataCommand { ]) } - fn usage(&self) -> &str { + fn description(&self) -> &str { "Retrieve metric metadata" } diff --git a/src/prometheus/prometheus_command.rs b/src/prometheus/prometheus_command.rs index a37b82f..cdc79b6 100644 --- a/src/prometheus/prometheus_command.rs +++ b/src/prometheus/prometheus_command.rs @@ -16,7 +16,7 @@ impl SimplePluginCommand for PrometheusCommand { Signature::build(self.name()).input_output_type(Type::Nothing, Type::Nothing) } - fn usage(&self) -> &str { + fn description(&self) -> &str { "Prometheus plugin" } diff --git a/src/prometheus/query_command.rs b/src/prometheus/query_command.rs index 09d041a..01a4feb 100644 --- a/src/prometheus/query_command.rs +++ b/src/prometheus/query_command.rs @@ -14,7 +14,7 @@ impl SimplePluginCommand for QueryCommand { fn signature(&self) -> Signature { Signature::build(self.name()) - .usage(self.usage()) + .description(self.description()) .named( "at", SyntaxShape::DateTime, @@ -38,7 +38,7 @@ impl SimplePluginCommand for QueryCommand { .input_output_type(Type::String, Type::Any) } - fn usage(&self) -> &str { + fn description(&self) -> &str { "Run an instant query" } diff --git a/src/prometheus/query_range_command.rs b/src/prometheus/query_range_command.rs index da6c0b9..5e8b634 100644 --- a/src/prometheus/query_range_command.rs +++ b/src/prometheus/query_range_command.rs @@ -14,7 +14,7 @@ impl SimplePluginCommand for QueryRangeCommand { fn signature(&self) -> Signature { Signature::build(self.name()) - .usage(self.usage()) + .description(self.description()) .named( "start", SyntaxShape::DateTime, @@ -50,7 +50,7 @@ impl SimplePluginCommand for QueryRangeCommand { .input_output_type(Type::String, Type::Any) } - fn usage(&self) -> &str { + fn description(&self) -> &str { "Run a range query" } diff --git a/src/prometheus/series_command.rs b/src/prometheus/series_command.rs index b1a903a..a6845b4 100644 --- a/src/prometheus/series_command.rs +++ b/src/prometheus/series_command.rs @@ -19,7 +19,7 @@ impl SimplePluginCommand for SeriesCommand { fn signature(&self) -> Signature { Signature::build(self.name()) - .usage(self.usage()) + .description(self.description()) .named( "source", SyntaxShape::String, @@ -43,7 +43,7 @@ impl SimplePluginCommand for SeriesCommand { ]) } - fn usage(&self) -> &str { + fn description(&self) -> &str { "Query for series" } diff --git a/src/prometheus/sources_command.rs b/src/prometheus/sources_command.rs index f4337ae..b983b11 100644 --- a/src/prometheus/sources_command.rs +++ b/src/prometheus/sources_command.rs @@ -14,11 +14,11 @@ impl SimplePluginCommand for SourcesCommand { fn signature(&self) -> Signature { Signature::build(self.name()) - .usage(self.usage()) + .description(self.description()) .input_output_type(Type::Nothing, Type::table()) } - fn usage(&self) -> &str { + fn description(&self) -> &str { "List configured sources" } diff --git a/src/prometheus/targets_command.rs b/src/prometheus/targets_command.rs index 126b4fa..d2a9bdd 100644 --- a/src/prometheus/targets_command.rs +++ b/src/prometheus/targets_command.rs @@ -15,7 +15,7 @@ impl SimplePluginCommand for TargetsCommand { fn signature(&self) -> Signature { Signature::build(self.name()) - .usage(self.usage()) + .description(self.description()) .named( "source", SyntaxShape::String, @@ -35,7 +35,7 @@ impl SimplePluginCommand for TargetsCommand { ]) } - fn usage(&self) -> &str { + fn description(&self) -> &str { "Query for target discovery state" }