Skip to content

Commit cc1193d

Browse files
committed
fix(api): scope prometheus middleware to /api to silence swagger-ui warnings
1 parent 722ef43 commit cc1193d

1 file changed

Lines changed: 1 addition & 2 deletions

File tree

api/src/lib.rs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -215,7 +215,6 @@ async fn start() -> anyhow::Result<()> {
215215

216216
let prometheus = PrometheusMetricsBuilder::new("api")
217217
.mask_unmatched_patterns("UNKNOWN")
218-
.exclude_regex(r"^/swagger-ui(/|$)")
219218
.build()
220219
.map_err(|e| anyhow!(e))?;
221220

@@ -273,7 +272,6 @@ async fn start() -> anyhow::Result<()> {
273272
let serv = HttpServer::new(move || {
274273
let mut app = App::new()
275274
.wrap(Compress::default())
276-
.wrap(prometheus.clone())
277275
.app_data(JsonConfig::default().limit(64 * 1024))
278276
.app_data(PayloadConfig::default().limit(256 * 1024))
279277
.app_data(conn_data.clone())
@@ -311,6 +309,7 @@ async fn start() -> anyhow::Result<()> {
311309
.add(("Vary", "Origin")),
312310
)
313311
.wrap(Cors::permissive())
312+
.wrap(prometheus.clone())
314313
.configure(move |cfg| {
315314
configure_public_api_routes(
316315
cfg,

0 commit comments

Comments
 (0)