Skip to content

Commit

Permalink
chore(metrics-observer,metrics-exporter-tcp): update to prost 0.12
Browse files Browse the repository at this point in the history
  • Loading branch information
tobz committed Dec 24, 2023
1 parent 4bc6c26 commit c04acc4
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 8 deletions.
6 changes: 3 additions & 3 deletions metrics-exporter-tcp/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -20,13 +20,13 @@ keywords = ["metrics", "telemetry", "tcp"]
metrics = { version = "^0.21", path = "../metrics" }
bytes = { version = "1", default-features = false }
crossbeam-channel = { version = "0.5", default-features = false, features = ["std"] }
prost = { version = "0.11", default-features = false }
prost-types = { version = "0.11", default-features = false, features = ["std"] }
prost = { version = "0.12", default-features = false }
prost-types = { version = "0.12", default-features = false, features = ["std"] }
mio = { version = "0.8", default-features = false, features = ["os-poll", "net"] }
tracing = { version = "0.1", default-features = false, features = ["attributes"] }

[build-dependencies]
prost-build = "0.11"
prost-build = "0.12"
home = "=0.5.5"

[dev-dependencies]
Expand Down
6 changes: 3 additions & 3 deletions metrics-observer/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -21,12 +21,12 @@ metrics = { version = "^0.21", path = "../metrics", default-features = false }
metrics-util = { version = "^0.15", path = "../metrics-util", default-features = false, features = ["summary"] }
bytes = { version = "1", default-features = false }
crossbeam-channel = { version = "0.5", default-features = false, features = ["std"] }
prost = { version = "0.11", default-features = false }
prost-types = { version = "0.11", default-features = false }
prost = { version = "0.12", default-features = false }
prost-types = { version = "0.12", default-features = false }
tui = { version = "0.19", default-features = false, features = ["termion"] }
termion = { version = "2", default-features = false }
chrono = { version = "0.4", default-features = false, features = ["clock"] }

[build-dependencies]
prost-build = "0.11"
prost-build = "0.12"
home = "=0.5.5"
7 changes: 5 additions & 2 deletions metrics-observer/src/metrics.rs
Original file line number Diff line number Diff line change
@@ -1,10 +1,13 @@
use std::collections::{BTreeMap, HashMap};
use std::io::Read;
use std::net::TcpStream;
use std::net::ToSocketAddrs;
use std::sync::{Arc, Mutex, RwLock};
use std::thread;
use std::time::Duration;
use std::{
collections::{BTreeMap, HashMap},
convert::TryFrom as _,
};

use bytes::{BufMut, BytesMut};
use prost::Message;
Expand Down Expand Up @@ -178,7 +181,7 @@ impl Runner {

match event {
Event::Metadata(metadata) => {
let metric_type = MetricType::from_i32(metadata.metric_type)
let metric_type = MetricType::try_from(metadata.metric_type)
.expect("unknown metric type over wire");
let metric_kind = match metric_type {
MetricType::Counter => MetricKind::Counter,
Expand Down

0 comments on commit c04acc4

Please sign in to comment.