-
Notifications
You must be signed in to change notification settings - Fork 164
Use stats handler instead of interceptor and add message size histograms #88
base: master
Are you sure you want to change the base?
Conversation
Update forks merge
f0f83f3
to
eba288c
Compare
Strange, when the test is performed hard on 1.11 versions, some results are not as expected, I need to test again.
|
3d3c285
to
98117bc
Compare
98117bc
to
36752fb
Compare
Codecov Report
@@ Coverage Diff @@
## master #88 +/- ##
==========================================
+ Coverage 72.45% 76.67% +4.22%
==========================================
Files 11 13 +2
Lines 363 566 +203
==========================================
+ Hits 263 434 +171
- Misses 89 115 +26
- Partials 11 17 +6
Continue to review full report at Codecov.
|
Any chance this PR could be looked at? |
|
||
rpcInfoKey = "rpc-info" | ||
|
||
defMsgBytesBuckets = []float64{0, 32, 64, 128, 256, 512, 1024, 2048, 8192, 32768, 131072, 524288} |
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.
Do you think it's possible to allow users to configure this value?
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.
This PR is in a good state 👍🏼
Looking forward to someone from the maintainers to pick it up as it would be very handy to have
Hi 👋🏽 Sorry for the massive, lag. We consolidating projects and moving to single repo where we have more control and awareness. We are moving this code base longer to https://github.com/grpc-ecosystem/go-grpc-middleware/tree/v2 and we moved existing state of Prometheus middleware to https://github.com/grpc-ecosystem/go-grpc-middleware/tree/v2/providers/openmetrics This means that before we release Sorry for the confusion, but it's needed for the project sustainability. Cheers! |
Can we avoid name "stats", it's not explicit, I am afraid. It sounds like we should have just |
Hi @bwplotka and thanks for restarting the conversation here!
I see that https://github.com/grpc-ecosystem/go-grpc-middleware/tree/v2/providers/openmetrics already has additional metrics compared to this branch, but does this also mean it is intended as a replacement for this package? |
Did this PR get moved to the new repo? I would love to have an easy way to monitor request size, sometimes the server goes under heavy load without the count of requests changing much and I hypothesize it may be because of bad actors submitting overly large payloads. |
Hi guys,
Working on #85
I add stats_handlers on server-side and client side, there is some question need discuss with you:
Is it to reuse existing metrics, default
grpc_type
tounary
or create some new metrics withoutgrpc_type
label.Or use some dynamic large methods, provide
grpc_type
when users use interceptors, and nogrpc_type
when users usestats.handler
[]float64{42, 2097, 52429, 1048576, 2097152, 3355443}
, according to the ratio of the message size to the default maximum value, the specific ratio is0.00001, 0.0005, 0.0125, 0.025, 0.5, 0.8
, do this make sense?