-
Notifications
You must be signed in to change notification settings - Fork 13k
Metrics: Add http_response_size_bytes metric #110428
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.
lgtm 👍
pkg/middleware/request_metrics.go
Outdated
func RequestMetrics(features featuremgmt.FeatureToggles, cfg *setting.Cfg, promRegister prometheus.Registerer) web.Middleware { | ||
log := log.New("middleware.request-metrics") | ||
|
||
log.Info("initializing request metrics middleware", "size_buckets", sizeDefBuckets) |
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.
was this for debug, or do we actually want it? 🤔
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.
nope!!!! thanks!
21c1fa8
to
4168e61
Compare
pkg/middleware/request_metrics.go
Outdated
durationHistogram.Observe(elapsedTime) | ||
} | ||
|
||
sizeHistogram.Observe(float64(rw.Size())) |
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.
why not also observe with an exemplar for this one? seems like it might be useful...
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.
ngl the code kinda scared me a little bit so i just ignored it, figuring if it's the right thing to do someone will tell me!
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.
/public/
route handler label value down into more granularplugin-assets
andpublic-build-assets
.public-assets
is still there, but is a fallback that we want to get down to 0.Fixes https://github.com/grafana/grafana-frontend-platform/issues/33