Skip to content

chore: Add MetricsRecorder interface to Datastore#12028

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

chore: Add MetricsRecorder interface to Datastore#12028
lqiu96 wants to merge 8 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.

public static final String ATTRIBUTES_KEY_MORE_RESULTS = "more_results";

/* TODO(lawrenceqiu): For now, these are a duplicate of method names in TraceUtil. Those will use these eventually */
public static final String METHOD_ALLOCATE_IDS = "AllocateIds";
Copy link
Contributor

Choose a reason for hiding this comment

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

I noticed that these are PascalCase, while others are lowercase (e.g. "add", "put"). Are there plans to standardize them?

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, this isn't consistent and I think ideally it should be in pascalcase. These constants we pulled from the existing TraceUtil file. I don't want to change this since there may be customers who are currently using those traces.

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