Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(bigtable): first_response_latencies and connectivity_error_count metrics #10616

Open
wants to merge 6 commits into
base: main
Choose a base branch
from

Conversation

bhshkh
Copy link
Contributor

@bhshkh bhshkh commented Jul 31, 2024

@product-auto-label product-auto-label bot added the api: bigtable Issues related to the Bigtable API. label Jul 31, 2024
@bhshkh bhshkh marked this pull request as ready for review August 1, 2024 17:54
@bhshkh bhshkh requested review from a team as code owners August 1, 2024 17:55
@bhshkh bhshkh requested a review from gkevinzheng August 1, 2024 17:55
@bhshkh bhshkh enabled auto-merge (squash) August 1, 2024 18:14
@@ -397,6 +400,7 @@ func (t *Table) readRows(ctx context.Context, arg RowSet, f func(Row) bool, mt *
*headerMD, _ = stream.Header()
for {
res, err := stream.Recv()
mt.currOp.setFirstRespTime(time.Now())
Copy link
Contributor

Choose a reason for hiding this comment

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

What happens when multiple responses are received?

what happens when there are no rows returned?

is the behavior consistent with java?

Does this work across retries?

Copy link
Contributor Author

@bhshkh bhshkh Sep 9, 2024

Choose a reason for hiding this comment

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

What happens when multiple responses are received?
Updated the code to set only on the first response.

serverLatAttrs, _ := mt.toOtelMetricAttrs(metricNameServerLatencies)
if mt.currOp.currAttempt.serverLatencyErr == nil {
mt.instrumentServerLatencies.Record(mt.ctx, mt.currOp.currAttempt.serverLatency, metric.WithAttributes(serverLatAttrs...))
}
if mt.currOp.currAttempt.serverLatencyErr == nil && mt.currOp.currAttempt.locationErr == nil {
mt.instrumentConnErrCount.Add(mt.ctx, 0, metric.WithAttributes(connErrCountAttrs...))
Copy link
Contributor

Choose a reason for hiding this comment

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

do you need to add a zero?

Copy link
Contributor Author

@bhshkh bhshkh Sep 9, 2024

Choose a reason for hiding this comment

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
api: bigtable Issues related to the Bigtable API.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants