-
Notifications
You must be signed in to change notification settings - Fork 8
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Metric tap agent #161
Merged
Merged
Metric tap agent #161
Changes from 1 commit
Commits
Show all changes
10 commits
Select commit
Hold shift + click to select a range
637e22b
feat: Add prometheus to tap agent
carlosvdr 9bb072b
wip: adding monitoring
carlosvdr 65bfd08
feat: Add prometheus metrics
carlosvdr ff3baa6
fix: uncomment metric
carlosvdr e88864d
fix: Added extra log
carlosvdr 2f3dae7
fix: Upgraded axum version
carlosvdr 1c1e3b9
fix: Corrected metrics
carlosvdr 97c218f
fix: Use better logging
carlosvdr 52d5cc2
fix: Add sender to metric label and more specific info
carlosvdr 630041a
fix: renaming of metrics
carlosvdr File filter
Filter by extension
Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -3,7 +3,7 @@ | |
|
||
use std::{net::SocketAddr, panic}; | ||
|
||
use axum::{http::StatusCode, response::IntoResponse, routing::get, Router, Server}; | ||
use axum::{http::StatusCode, response::IntoResponse, routing::get, Router}; | ||
use futures_util::FutureExt; | ||
use jsonrpsee::tracing::error; | ||
use log::{debug, info}; | ||
|
@@ -34,7 +34,8 @@ async fn _run_server(port: u16) { | |
.route("/metrics", get(handler_metrics)) | ||
.fallback(handler_404); | ||
let addr = SocketAddr::from(([0, 0, 0, 0], port)); | ||
let server = Server::bind(&addr).serve(app.into_make_service()); | ||
let listener = tokio::net::TcpListener::bind(addr).await.unwrap(); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. use |
||
let server = axum::serve(listener, app.into_make_service()); | ||
|
||
info!("Metrics server listening on {}", addr); | ||
|
||
|
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hmm I can't remember why I used
jsonrpsee::tracing::error
here https://github.com/semiotic-ai/timeline-aggregation-protocol/blob/c179dfedee1ed8078b358de3d35f4d051f74c9c1/tap_aggregator/src/metrics.rs#L8But in any case, it should look less weird with
tracing::error
instead.