chore: Add MetricsRecorder interface to Datastore#12028
Merged
Conversation
jinseopkim0
approved these changes
Mar 2, 2026
blakeli0
reviewed
Mar 2, 2026
| import javax.annotation.Nonnull; | ||
|
|
||
| /** Interface to record specific metric operations. */ | ||
| public interface MetricsRecorder { |
Contributor
There was a problem hiding this comment.
Two questions:
- Do we need another layer for built in metrics? If we don't plan to use a different framework for built in metrics, and/or let customers record these metrics by themselves, maybe we can have a
OpenTemeletryMetricsRecorderdirectly? - If we do want another layer, maybe this interface can be package private as well?
Member
Author
There was a problem hiding this comment.
Oh, oops. I didn't realize this was public. I will create a PR to remove this visibility before a new version is cut.
I was thinking there would be something like (names not set in stone):
MetricsRecorder
-> CompositeMetricsRecorder (will take any number of MetricRecorder impls)
-> OpenTelemetryMetricsRecorder (takes in otel object so this can be configured to be built-in or customer supplied)
I'm still thinking through the built-in aspect and I'll reduce visibility to allow for change in the future.
lqiu96
added a commit
that referenced
this pull request
Mar 20, 2026
Adds the Otel Metrics Recording Implementation as well as the No-Op Metrics Recording implementation for Datastore. The implementation will be chosen based on the opt-in or opt-out choice for Metrics recording.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Adds the Otel Metrics Recording Implementation as well as the No-Op Metrics Recording implementation for Datastore.
The implementation will be chosen based on the opt-in or opt-out choice for Metrics recording.