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

Locate: Add histogram for Memorystore request duration #152

Merged
merged 3 commits into from
Jul 31, 2023

Conversation

cristinaleonr
Copy link
Contributor

@cristinaleonr cristinaleonr commented Jul 28, 2023

This PR adds a new metric to keep track of how long it takes for the Locate to issue requests to Memorystore.


This change is Reviewable

Copy link
Contributor

@stephen-soltesz stephen-soltesz left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Some small questions.

Reviewed 2 of 4 files at r1.
Reviewable status: 0 of 1 approvals obtained (waiting on @cristinaleonr)


memorystore/client.go line 53 at r1 (raw file):

	}

	metrics.LocateMemorystoreRequestDuration.WithLabelValues("put", field, "OK").Observe(time.Since(t).Seconds())

Is the same field name every both "expire=true" and "expire=false"? I'm wondering about the potential of mixed use of "OK" and whether that matters.


metrics/metrics.go line 63 at r1 (raw file):

			Name:    "locate_memorystore_request_duration",
			Help:    "A histogram of request latency to Memorystore.",
			Buckets: prometheus.LinearBuckets(0, 2, 16), // Buckets from 0 to 30 with steps of size 2.

This feels a little coarse-grain.

But, I guess we're primarily looking for large outliners..

Did you consider smaller steps in the low end? e.g. like steps before 1 in prometheus.DefBuckets?

Copy link
Contributor Author

@cristinaleonr cristinaleonr left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reviewable status: 0 of 1 approvals obtained (waiting on @stephen-soltesz)


memorystore/client.go line 53 at r1 (raw file):

Previously, stephen-soltesz (Stephen Soltesz) wrote…

Is the same field name every both "expire=true" and "expire=false"? I'm wondering about the potential of mixed use of "OK" and whether that matters.

I added a suffix to differentiate between "expire=true" and "expire=false".


metrics/metrics.go line 63 at r1 (raw file):

Previously, stephen-soltesz (Stephen Soltesz) wrote…

This feels a little coarse-grain.

But, I guess we're primarily looking for large outliners..

Did you consider smaller steps in the low end? e.g. like steps before 1 in prometheus.DefBuckets?

Yes, we're primarily looking for request durations that could contribute to the entries' expiration.

I have added smaller steps before 1.

Copy link
Contributor Author

@cristinaleonr cristinaleonr left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@stephen-soltesz PTAL when you get a chance.

Reviewable status: 0 of 1 approvals obtained (waiting on @stephen-soltesz)

Copy link
Contributor

@stephen-soltesz stephen-soltesz left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you. :lgtm:

Reviewed 2 of 3 files at r2, 1 of 1 files at r3.
Reviewable status: :shipit: complete! 1 of 1 approvals obtained

@cristinaleonr cristinaleonr merged commit 7c9f1ff into main Jul 31, 2023
@cristinaleonr cristinaleonr deleted the sandbox-cristinaleon-memorystore-latency-metrics branch July 31, 2023 18:58
@cristinaleonr
Copy link
Contributor Author

Related to #149.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants