Skip to content

Commit 801fc4f

Browse files
author
datacore-bolt-ci
committed
ci(stability): merge the develop branch
2 parents 00ccbdd + b24823e commit 801fc4f

File tree

2 files changed

+11
-5
lines changed

2 files changed

+11
-5
lines changed

metrics-exporter/src/bin/io_engine/client/grpc_client.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ use crate::client::{
77
replica_stat::{ReplicaIoStat, ReplicaIoStats},
88
};
99
use actix_web::http::Uri;
10-
use std::time::Duration;
10+
use std::{net::SocketAddr, time::Duration};
1111
use tokio::time::sleep;
1212
use tonic::transport::Channel;
1313
use tracing::error;
@@ -112,7 +112,7 @@ pub(crate) async fn init_client() -> Result<GrpcClient, ExporterError> {
112112
let _ = get_node_name()?;
113113
let endpoint = Uri::builder()
114114
.scheme("https")
115-
.authority(format!("{pod_ip}:10124"))
115+
.authority(SocketAddr::new(pod_ip, 10124).to_string())
116116
.path_and_query("")
117117
.build()
118118
.map_err(|error| ExporterError::InvalidURI(error.to_string()))?;

metrics-exporter/src/bin/io_engine/main.rs

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,10 @@ use crate::{
66
use actix_web::{middleware, HttpServer};
77
use clap::Parser;
88
use once_cell::sync::OnceCell;
9-
use std::{env, net::SocketAddr};
9+
use std::{
10+
env,
11+
net::{IpAddr, SocketAddr},
12+
};
1013
use utils::tracing_telemetry::{FmtLayer, FmtStyle};
1114

1215
/// Cache module for exporter.
@@ -26,8 +29,11 @@ async fn initialize_cache() {
2629
}
2730

2831
/// Get pod ip from env.
29-
fn get_pod_ip() -> Result<String, ExporterError> {
30-
env::var("MY_POD_IP").map_err(|_| ExporterError::PodIPError("Unable to get pod ip".to_string()))
32+
fn get_pod_ip() -> Result<IpAddr, ExporterError> {
33+
let ip = env::var("MY_POD_IP")
34+
.map_err(|_| ExporterError::PodIPError("Unable to get pod ip".to_string()))?;
35+
ip.parse::<IpAddr>()
36+
.map_err(|_| ExporterError::PodIPError("Invalid pod ip".to_string()))
3137
}
3238

3339
/// Get node name from env.

0 commit comments

Comments
 (0)