-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
10 changed files
with
158 additions
and
6 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
[env] | ||
AXUM_HTTP_REQUESTS_TOTAL = "notifico_http_requests_total" | ||
AXUM_HTTP_REQUESTS_DURATION_SECONDS = "notifico_http_requests_duration_seconds" | ||
AXUM_HTTP_REQUESTS_PENDING = "notifico_http_requests_pending" | ||
AXUM_HTTP_RESPONSE_BODY_SIZE = "notifico_http_response_body_size" |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
use axum::routing::get; | ||
use axum::Router; | ||
use axum_prometheus::metrics_exporter_prometheus::PrometheusHandle; | ||
use axum_prometheus::PrometheusMetricLayer; | ||
use std::net::SocketAddr; | ||
use tokio::net::TcpListener; | ||
|
||
pub async fn start(bind: SocketAddr, handle: PrometheusHandle) { | ||
// Bind everything now to catch any errors before spinning up the coroutines | ||
let listener = TcpListener::bind(bind).await.unwrap(); | ||
|
||
// API | ||
let app = Router::new() | ||
.route("/metrics", get(|| async move { handle.render() })) | ||
.layer(PrometheusMetricLayer::new()); | ||
|
||
tokio::spawn(async { axum::serve(listener, app).await.unwrap() }); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,5 @@ | ||
pub mod auth; | ||
pub mod ingest; | ||
pub mod metrics; | ||
pub mod public; | ||
pub mod ui; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters