Skip to content
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

Merged
merged 7 commits into from
Jul 22, 2024
Merged

Conversation

lukasz-antoniak
Copy link
Contributor

No description provided.

Copy link
Collaborator

@joao-r-reis joao-r-reis left a 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 Show resolved Hide resolved
proxy/pkg/metrics/node_metrics.go Outdated Show resolved Hide resolved
proxy/pkg/metrics/proxy_metrics.go Show resolved Hide resolved
@@ -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) {
Copy link
Collaborator

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})

Copy link
Collaborator

@joao-r-reis joao-r-reis left a 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

@lukasz-antoniak lukasz-antoniak marked this pull request as ready for review July 22, 2024 12:28
@lukasz-antoniak lukasz-antoniak merged commit b68856d into main Jul 22, 2024
8 checks passed
@lukasz-antoniak lukasz-antoniak deleted the ZDM-584 branch July 22, 2024 12:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants