feat(v2): implement basic metric recording function#487
feat(v2): implement basic metric recording function#487quartzmo merged 5 commits intogoogleapis:mainfrom
Conversation
91da9bc to
c96eac9
Compare
| point := histo.DataPoints[0] | ||
|
|
||
| // Verify the duration value corresponds to the sum. | ||
| if point.Sum != 1.5 { |
There was a problem hiding this comment.
Do we need to define an epsilon error bound since we're testing floating point equality? We're probably okay since we're only testing a literal duration transformation, but if we find jitter is exposed from the otel layer it might be something to add later.
There was a problem hiding this comment.
I think it's a good idea, I added it.
d8b1638 to
f05a22a
Compare
85eb494 to
53a25a1
Compare
quartzmo
left a comment
There was a problem hiding this comment.
This PR copies/adapts logic from cloud.google.com/go/auth (googleapis/google-cloud-go#14133). Gax seems to me to be the better home for this logic. Can we export it in this PR and then update cloud.google.com/go/auth to use the Gax exports?
Can you provide a code snippet preview in the PR description of how you think Invoke/invoke will call |
53a25a1 to
d1bc0d6
Compare
d1bc0d6 to
b055edf
Compare
540e394 to
e790ab5
Compare
e790ab5 to
80c44d0
Compare
5356c09 to
55a8f4d
Compare
| Metadata map[string]string | ||
|
|
||
| // _ struct{} prevents unkeyed struct literals, ensuring backwards | ||
| // compatibility when new fields are added in the future. |
| // | ||
| // Experimental: This function is experimental and may be modified or removed in future versions, | ||
| // regardless of any other documented package stability guarantees. | ||
| func ExtractTelemetryErrorInfo(ctx context.Context, err error) TelemetryErrorInfo { |
There was a problem hiding this comment.
As a pure parser that now returns a clean data struct from inputs, this is a big improvement over the original version in auth. Nice work!
This PR introduces the internal
recordMetricfunction, which emits thegcp.client.request.durationmetric.It also introduces two exported APIs:
Subsequent PRs will hook this function into
gax.Invokeand expand the recorded attributes with dynamic error statuses and transport metadata.We would add this to invoke:
64a4698