-
Notifications
You must be signed in to change notification settings - Fork 20
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
Expose read and write request latency in metrics #125
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.
Some comments. This approach probably works fine but I think we should do the same thing as we are doing for the read/write metrics on the proxy metrics to be consistent.
proxy/pkg/metrics/node_metrics.go
Outdated
@@ -298,9 +299,13 @@ func CreateCounterNodeMetric(metricFactory MetricFactory, nodeDescription string | |||
return m, nil | |||
} | |||
|
|||
func CreateHistogramNodeMetric(metricFactory MetricFactory, nodeDescription string, mn Metric, buckets []float64) (Histogram, error) { | |||
func CreateHistogramNodeMetric(metricFactory MetricFactory, nodeDescription string, mn Metric, buckets []float64, labels ...string) (Histogram, error) { |
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.
the labels ...string
is not very obvious, it's a list where evens are keys and odds are values for those keys... Can we make it a simple map[string]string
instead? Or create a new label type:
1:
type MetricLabel struct {
Key string
Value string
}
func CreateHistogramNodeMetric(metricFactory MetricFactory, nodeDescription string, mn Metric, buckets []float64, labels ...MetricLabel) (Histogram, error) { }
metrics.CreateHistogramNodeMetric(metricFactory, asyncNodeDescription, metrics.AsyncRequestDuration, asyncBuckets, metrics.MetricLabel{Key: metrics.RequestDurationTypeLabel, Value: metrics.TypeReads})
2:
func CreateHistogramNodeMetric(metricFactory MetricFactory, nodeDescription string, mn Metric, buckets []float64, labels map[string]string) (Histogram, error) { }
metrics.CreateHistogramNodeMetric(metricFactory, asyncNodeDescription, metrics.AsyncRequestDuration, asyncBuckets, map[string]string{metrics.RequestDurationTypeLabel: metrics.TypeReads})
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.
looks good, left just a NIT comment, feel free to ignore it if you think it's not important
No description provided.