Skip to content

Commit 49491eb

Browse files
authored
Fix metrics endpoint for axum path (#116)
1 parent 5d621f8 commit 49491eb

File tree

4 files changed

+10
-4
lines changed

4 files changed

+10
-4
lines changed

auction-server/Cargo.lock

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

auction-server/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[package]
22
name = "auction-server"
3-
version = "0.9.6"
3+
version = "0.9.7"
44
edition = "2021"
55
license-file = "license.txt"
66

auction-server/src/api.rs

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,10 @@ use {
6868
},
6969
TypedHeader,
7070
},
71-
axum_prometheus::PrometheusMetricLayerBuilder,
71+
axum_prometheus::{
72+
EndpointLabel,
73+
PrometheusMetricLayerBuilder,
74+
},
7275
clap::crate_version,
7376
ethers::types::Bytes,
7477
serde::{
@@ -387,6 +390,9 @@ pub async fn start_api(run_options: RunOptions, store: Arc<Store>) -> Result<()>
387390

388391
let (prometheus_layer, _) = PrometheusMetricLayerBuilder::new()
389392
.with_metrics_from_fn(|| store.metrics_recorder.clone())
393+
.with_endpoint_label_type(EndpointLabel::MatchedPathWithFallbackFn(|_| {
394+
"unknown".to_string()
395+
}))
390396
.build_pair();
391397
let app: Router<()> = Router::new()
392398
.merge(SwaggerUi::new("/docs").url("/docs/openapi.json", ApiDoc::openapi()))

scripts/opportunity-provider/opportunities.mainnet.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,6 @@
88
"address": "0xd988097fb8612cc24eeC14542bC03424c656005f",
99
"symbol": "USDT"
1010
},
11-
"sellAmount": 0.01
11+
"sellAmount": 0.001
1212
}
1313
]

0 commit comments

Comments
 (0)