Use /metrics route

This commit is contained in:
jude 2023-10-22 10:39:12 +01:00
parent 48b50f783d
commit 4c17286614
3 changed files with 4 additions and 3 deletions

2
Cargo.lock generated
View File

@ -2215,7 +2215,7 @@ dependencies = [
[[package]] [[package]]
name = "soundfx-rs" name = "soundfx-rs"
version = "1.5.12" version = "1.5.13"
dependencies = [ dependencies = [
"axum", "axum",
"dashmap", "dashmap",

View File

@ -2,7 +2,7 @@
name = "soundfx-rs" name = "soundfx-rs"
description = "Discord bot for custom sound effects and soundboards" description = "Discord bot for custom sound effects and soundboards"
license = "AGPL-3.0-only" license = "AGPL-3.0-only"
version = "1.5.12" version = "1.5.14"
authors = ["jellywx <judesouthworth@pm.me>"] authors = ["jellywx <judesouthworth@pm.me>"]
edition = "2018" edition = "2018"
@ -30,6 +30,7 @@ metrics = ["dep:prometheus", "dep:axum"]
serenity = { version = "0.11.6" } serenity = { version = "0.11.6" }
[package.metadata.deb] [package.metadata.deb]
features = ["metrics"]
depends = "$auto, ffmpeg" depends = "$auto, ffmpeg"
suggests = "mysql-server-8.0" suggests = "mysql-server-8.0"
maintainer-scripts = "debian" maintainer-scripts = "debian"

View File

@ -20,7 +20,7 @@ pub fn init_metrics() {
} }
pub async fn serve() { pub async fn serve() {
let app = Router::new().route("/", get(metrics)); let app = Router::new().route("/metrics", get(metrics));
let addr = SocketAddr::from(([127, 0, 0, 1], 31755)); let addr = SocketAddr::from(([127, 0, 0, 1], 31755));
axum::Server::bind(&addr) axum::Server::bind(&addr)