Skip to content

chore(Datastore): Add Operation and Attempt metrics for HttpJson transport#12086

Merged
lqiu96 merged 3 commits intomainfrom
http-metrics-operations-attempt-2
Mar 17, 2026
Merged

chore(Datastore): Add Operation and Attempt metrics for HttpJson transport#12086
lqiu96 merged 3 commits intomainfrom
http-metrics-operations-attempt-2

Conversation

@lqiu96
Copy link
Member

@lqiu96 lqiu96 commented Mar 16, 2026

This adds operation and attempt metrics that are being recorded via Gax. Since gRPC can integrate natively with Gax, this metrics are captured. This instruments the metrics to be collected via HttpJson.

Sample view of the metrics collected:
image

@lqiu96 lqiu96 requested a review from jinseopkim0 March 16, 2026 17:42
@lqiu96 lqiu96 requested a review from a team as a code owner March 16, 2026 17:42
Comment on lines +118 to +123
String status = StatusCode.Code.OK.toString();
try {
return callable.call();
} catch (Exception e) {
status = DatastoreException.extractStatusCode(e);
throw e;
Copy link
Contributor

Choose a reason for hiding this comment

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

If we get an Error that's not caught, then the status would remain as OK, right? Would it make sense to set the OK status later? e.g.

String status = StatusCode.Code.UNKNOWN.toString();
try {
  T result = callable.call();
  status = StatusCode.Code.OK.toString();
  return result;
} catch (Exception e) {
  // ...

Copy link
Member Author

Choose a reason for hiding this comment

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

Oh I see what you're saying. Ok, let me update that

@lqiu96 lqiu96 enabled auto-merge (squash) March 17, 2026 18:41
@lqiu96 lqiu96 merged commit 52f007e into main Mar 17, 2026
53 checks passed
@lqiu96 lqiu96 deleted the http-metrics-operations-attempt-2 branch March 17, 2026 19:41
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