Skip to content

chore: Add MetricsRecorder interface to Datastore#12028

Open
lqiu96 wants to merge 9 commits intomainfrom
feat/datastore-metrics-recorder
Open

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

Conversation

@lqiu96
Copy link
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

this.transactionLatency =
meter
.histogramBuilder(TelemetryConstants.SERVICE_NAME + "/transaction_latency")
Copy link
Contributor

Choose a reason for hiding this comment

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

Do we need /internal/client prefixes?

Copy link
Member Author

Choose a reason for hiding this comment

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

I'm not 100% sure about this long-term. I think I would need to run this by the platform team. For now, since it's not being sent, I think this prefix should be fine. Since we're not promoting this yet, I think we should be able to change this in the future.

Copy link
Contributor

Choose a reason for hiding this comment

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

It's possible to have customers use this metric though (via their own OTel exporters), right? I think it'll be worth confirming with the platform team. WDYT?

Copy link
Member Author

Choose a reason for hiding this comment

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

Yeah, technically they would have to find this and enable metrics, but they could.

For now, to progress with the rest of the framework, I'll update the option to enable metrics as package-private so there is no way for users to record these metrics even if they wanted to

@lqiu96 lqiu96 requested a review from jinseopkim0 February 28, 2026 00:36
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