-
Notifications
You must be signed in to change notification settings - Fork 834
Additional GRPC stats #3036
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
Additional GRPC stats #3036
Conversation
Signed-off-by: Peter Štibraný <[email protected]>
Signed-off-by: Peter Štibraný <[email protected]>
Signed-off-by: Peter Štibraný <[email protected]>
Fixed test for connected clients. Signed-off-by: Peter Štibraný <[email protected]>
Signed-off-by: Peter Štibraný <[email protected]>
Signed-off-by: Peter Štibraný <[email protected]>
Signed-off-by: Peter Štibraný <[email protected]>
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.
Excellent work! I left few comments, but overall LGTM 👏
Signed-off-by: Peter Štibraný <[email protected]>
Signed-off-by: Peter Štibraný <[email protected]>
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.
Excellent, LGTM!
Converted to draft until fate of weaveworks/common#196 is known. It would replace this PR. |
I reviewed in ww/common, LGTM there. Feel free to re-add me when thats merged. |
|
||
return &grpcStatsHandler{ | ||
connectedClients: promauto.With(r).NewGauge(prometheus.GaugeOpts{ | ||
Name: "cortex_grpc_connected_clients", |
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.
Suggestion(non-blocking): This struct has a large potential for reuse in other projects. Would you mind making the cortex
prefix a configurable namespace?
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.
Thanks for suggestion. I plan to drop this PR if/when weaveworks/common#196 gets merged. If weaveworks/common#196 doesn't get accepted, I will reconsider this feedback.
Closing in favor of #3064, which includes similar enhancements. |
What this PR does: This PR introduces new gRPC-related metrics:
cortex_grpc_connected_clients
– number of connected grpc clients to servercortex_grpc_inflight_requests
– number of inflight requests per methodcortex_grpc_method_errors_total
– number of errors returned by each methodcortex_grpc_received_payload_size_bytes
– histogram for incoming messages, per methodcortex_grpc_sent_payload_size_bytes
– histogram for outgoing messages, per methodHeaders and trailers are not tracked, as it's difficult to correctly measure their size, and Cortex doesn't use them anyway.
Bucket sizes for histogram are based on default values used by Cortex (4 MB message size).
Checklist
CHANGELOG.md
updated - the order of entries should be[CHANGE]
,[FEATURE]
,[ENHANCEMENT]
,[BUGFIX]