diff --git a/Cargo.lock b/Cargo.lock index 702a705..8f739e2 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1620,7 +1620,7 @@ checksum = "953ec861398dccce10c670dfeaf3ec4911ca479e9c02154b3a215178c5f566f2" [[package]] name = "pony" -version = "0.0.9" +version = "0.0.12" dependencies = [ "actix-web", "actix-web-httpauth", diff --git a/Cargo.toml b/Cargo.toml index 97d6ef7..e4e3ac8 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "pony" -version = "0.0.9" +version = "0.0.12" edition = "2021" [dependencies] diff --git a/pony.service b/pony.service deleted file mode 100644 index 6e9786a..0000000 --- a/pony.service +++ /dev/null @@ -1,17 +0,0 @@ -[Unit] -Description=Pony - Daemon to send metrics to carbon -After=network.target - -[Service] -User=root -Group=root - -WorkingDirectory=/root/ponytoring/ - -ExecStart=/root/ponytoring/pony - -Restart=on-failure -RestartSec=5s - -[Install] -WantedBy=multi-user.target diff --git a/release.sh b/release.sh index 964662e..d67a8fd 100755 --- a/release.sh +++ b/release.sh @@ -9,9 +9,8 @@ NEW_VERSION="$1" CARGO_TOML_PATH="Cargo.toml" echo "Updating version in $CARGO_TOML_PATH to $NEW_VERSION..." -sed -i 's|^version = \".*\"|version = \"$NEW_VERSION\"|' "$CARGO_TOML_PATH" +CARGO_TOML_PATH="Cargo.toml" NEW_VERSION=0.0.10 sed "s|^version = \".*\"|version = \"$NEW_VERSION\"|" $CARGO_TOML_PATH -sed 's|^version = \".*\"|version = \"$NEW_VERSION\"|' Cargo.toml if [ $? -ne 0 ]; then echo "Failed to update version in $CARGO_TOML_PATH" diff --git a/src/web.rs b/src/web.rs index b2088ef..e83d679 100644 --- a/src/web.rs +++ b/src/web.rs @@ -68,7 +68,7 @@ pub async fn status(req: Path, ch_client: Data>) -> impl Res }; for (metric, value) in metrics_value_bps { - if let Some(stripped_metric) = metric.strip_prefix("dev.") { + if let Some(stripped_metric) = metric.strip_prefix(format!("{}.", req.cluster).as_str()) { let parts: Vec<&str> = stripped_metric.split(".").collect(); let key = format!("bps.{}.{}.{}", parts[0], parts[2], parts[3]); metrics_map_result.insert(key, value); @@ -79,6 +79,8 @@ pub async fn status(req: Path, ch_client: Data>) -> impl Res metrics_map_result.insert(format!("connections.{}.total", prefix), sum); } + debug!("Metrics Result {:?}", metrics_map_result); + HttpResponse::Ok().json(metrics_map_result) }