-
Notifications
You must be signed in to change notification settings - Fork 115
fix(guard): add more tokio runtime metrics, remove labels from metrics #2485
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
Conversation
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.
PR Summary
This PR enhances Tokio runtime observability while simplifying guard service metrics to reduce cardinality.
- Added
TOKIO_TASK_TOTAL
andTOKIO_ACTIVE_TASK_COUNT
metrics inpackages/common/runtime/src/metrics.rs
for tracking task lifecycle - Removed actor_id, server_id, method, and path labels from
PROXY_REQUEST_TOTAL
andPROXY_REQUEST_PENDING
inpackages/edge/infra/guard/core/src/metrics.rs
- Simplified
PROXY_REQUEST_DURATION
to only track status label - Added error tracking via
PROXY_REQUEST_ERROR
with error_type label - Configured Tokio runtime builder to collect new task metrics in
packages/common/runtime/src/lib.rs
4 file(s) reviewed, 2 comment(s)
Edit PR Review Bot Settings | Greptile
metrics::PROXY_REQUEST_ERROR | ||
.with_label_values(&[&err.to_string()]) | ||
.inc(); |
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.
style: Consider using structured error types instead of error.to_string() to avoid high cardinality in error labels
metrics::PROXY_REQUEST_PENDING.inc(); | ||
|
||
metrics::PROXY_REQUEST_TOTAL | ||
.with_label_values(&[&actor_id_str, &server_id_str, method_str, &path]) | ||
.inc(); | ||
metrics::PROXY_REQUEST_TOTAL.inc(); |
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.
logic: Metrics incremented before error handling - could lead to inaccurate counts if subsequent operations fail
Deploying rivet with
|
Latest commit: |
0bf9b0a
|
Status: | ✅ Deploy successful! |
Preview URL: | https://f83682c1.rivet.pages.dev |
Branch Preview URL: | https://05-28-fix-guard-add-more-tok.rivet.pages.dev |
fca464f
to
ce70387
Compare
Deploying rivet-studio with
|
Latest commit: |
0bf9b0a
|
Status: | ✅ Deploy successful! |
Preview URL: | https://9b699cf3.rivet-studio.pages.dev |
Branch Preview URL: | https://05-28-fix-guard-add-more-tok.rivet-studio.pages.dev |
Deploying rivet-hub with
|
Latest commit: |
0bf9b0a
|
Status: | ✅ Deploy successful! |
Preview URL: | https://255bbf9c.rivet-hub-7jb.pages.dev |
Branch Preview URL: | https://05-28-fix-guard-add-more-tok.rivet-hub-7jb.pages.dev |
fcd1624
to
d958baa
Compare
ce70387
to
08138ed
Compare
d958baa
to
4134605
Compare
08138ed
to
f6d2ad5
Compare
4134605
to
d958baa
Compare
f6d2ad5
to
08138ed
Compare
d958baa
to
4134605
Compare
08138ed
to
f6d2ad5
Compare
4134605
to
d958baa
Compare
f6d2ad5
to
08138ed
Compare
d958baa
to
4134605
Compare
08138ed
to
f6d2ad5
Compare
4134605
to
6caa5bf
Compare
f6d2ad5
to
0bf9b0a
Compare
Changes