Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix parsing IPv6 addresses #6

Merged
merged 1 commit into from
Aug 17, 2021
Merged
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
8 changes: 4 additions & 4 deletions src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ use prometheus_exporter::{
};
use std::{
convert::TryInto,
net::SocketAddr
net::{IpAddr, SocketAddr}
};

mod nfs;
Expand Down Expand Up @@ -60,11 +60,11 @@ fn main() {
Builder::from_env(Env::default().default_filter_or("info")).init();

// Parse address used to bind exporter to.
let addr_raw = format!("{}:{}", addr, port);
let addr: SocketAddr = addr_raw.parse().expect("can not parse listen addr");
let ia: IpAddr = addr.parse().unwrap();
let sa = SocketAddr::new(ia, port.parse().unwrap());

// Start exporter.
let (request_receiver, finished_sender) = PrometheusExporter::run_and_notify(addr);
let (request_receiver, finished_sender) = PrometheusExporter::run_and_notify(sa);

// Create metrics
// Even though these are gauge, we use the Gauge API since the kernel
Expand Down