Skip to content

chore: Add MetricsRecorder interface to Datastore#12028

Merged
lqiu96 merged 9 commits intomainfrom
feat/datastore-metrics-recorder
Mar 2, 2026
Merged

chore: Add MetricsRecorder interface to Datastore#12028
lqiu96 merged 9 commits intomainfrom
feat/datastore-metrics-recorder

Conversation

@lqiu96
Copy link
Copy Markdown
Member

@lqiu96 lqiu96 commented Feb 25, 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.

@lqiu96 lqiu96 requested a review from jinseopkim0 February 26, 2026 18:09
@lqiu96 lqiu96 marked this pull request as ready for review February 26, 2026 18:09
@lqiu96 lqiu96 requested a review from a team as a code owner February 26, 2026 18:09
@lqiu96 lqiu96 requested a review from jinseopkim0 February 28, 2026 00:36
@lqiu96 lqiu96 merged commit cfb2af3 into main Mar 2, 2026
73 of 74 checks passed
@lqiu96 lqiu96 deleted the feat/datastore-metrics-recorder branch March 2, 2026 15:59
import javax.annotation.Nonnull;

/** Interface to record specific metric operations. */
public interface MetricsRecorder {
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Two questions:

  1. 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 OpenTemeletryMetricsRecorder directly?
  2. If we do want another layer, maybe this interface can be package private as well?

Copy link
Copy Markdown
Member Author

@lqiu96 lqiu96 Mar 2, 2026

Choose a reason for hiding this comment

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

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.
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.

3 participants