-
Notifications
You must be signed in to change notification settings - Fork 27
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
feat(starknet_monitoring_endpoint): add metrics endpoint #2469
Conversation
This stack of pull requests is managed by Graphite. Learn more about stacking. |
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #2469 +/- ##
===========================================
+ Coverage 40.10% 77.40% +37.29%
===========================================
Files 26 387 +361
Lines 1895 41449 +39554
Branches 1895 41449 +39554
===========================================
+ Hits 760 32083 +31323
- Misses 1100 7083 +5983
- Partials 35 2283 +2248 ☔ View full report in Codecov by Sentry. |
e12e596
to
4cb7c68
Compare
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.
Reviewable status: 0 of 4 files reviewed, 3 unresolved discussions (waiting on @dan-starkware)
crates/starknet_monitoring_endpoint/src/monitoring_endpoint.rs
line 101 at r1 (raw file):
None => StatusCode::METHOD_NOT_ALLOWED.into_response(), } }
Are we expected not to collect metrics at some point? IIUC this is turned on once, and we'll keep adding new relevant metrics as we go.
Could we avoid using Option
here, and simply return handle.render().into_response()
?
Code quote:
/// In case the node doesn’t collect metrics returns an empty response with status code 405: method
/// not allowed.
#[instrument(level = "debug", ret, skip(prometheus_handle))]
async fn metrics(prometheus_handle: Option<PrometheusHandle>) -> Response {
match prometheus_handle {
Some(handle) => handle.render().into_response(),
None => StatusCode::METHOD_NOT_ALLOWED.into_response(),
}
}
crates/starknet_monitoring_endpoint/src/monitoring_endpoint_test.rs
line 51 at r1 (raw file):
#[tokio::test] async fn test_ready() {
Could you please align the test names (with/without test_
prefix) within this module? I don't mind to which, just aiming for consistency.
Code quote:
async fn test_ready() {
crates/starknet_monitoring_endpoint/src/monitoring_endpoint_test.rs
line 69 at r1 (raw file):
absolute_counter!(metric_name, metric_value); let response = request_app(app, crate::monitoring_endpoint::METRICS).await;
Please import at top, and use METRICS
here.
Code quote:
crate::monitoring_endpoint::METRICS
4cb7c68
to
0f1bae3
Compare
0f1bae3
to
9786f69
Compare
Previously, Itay-Tsabary-Starkware wrote…
Done. |
Previously, Itay-Tsabary-Starkware wrote…
Done further up the stack |
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.
Reviewed 2 of 4 files at r1, 2 of 2 files at r2, all commit messages.
Reviewable status: complete! all files reviewed, all discussions resolved (waiting on @dan-starkware)
crates/starknet_monitoring_endpoint/src/monitoring_endpoint.rs
line 101 at r1 (raw file):
Previously, Itay-Tsabary-Starkware wrote…
Are we expected not to collect metrics at some point? IIUC this is turned on once, and we'll keep adding new relevant metrics as we go.
Could we avoid usingOption
here, and simply returnhandle.render().into_response()
?
Could you please add a todo on my name (tsabary) to handle the Option
setup?
Changed to non-blocking
9786f69
to
d9e044c
Compare
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.
Reviewed 1 of 4 files at r1, 1 of 2 files at r2, 2 of 2 files at r3, all commit messages.
Reviewable status: complete! all files reviewed, all discussions resolved (waiting on @dan-starkware)
Merge activity
|
No description provided.