-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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(storage): add grpc metrics experimental options #10984
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks great overall, thanks for figuring this out Frank!
storage/experimental/experimental.go
Outdated
"google.golang.org/api/option" | ||
) | ||
|
||
// WithMetricInterval how often to emit metrics when using NewPeriodicReader |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Make it clear that these options are supposed to be used with storage.NewClient.
Also, looks like your unit test fails... can you investigate? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Couple minor nits/questions, overall looks good
storage/experimental/experimental.go
Outdated
"google.golang.org/api/option" | ||
) | ||
|
||
// WithMetricInterval provides a [ClientOption] that may be passed to [storage.NewGrpcClient]. | ||
// It sets how often to emit metrics when using NewPeriodicReader and must be | ||
// greater than 1 minute. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why is this the minimum? Not sure why this requires validation, users might have their own systems with higher rate limits.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good point; could pass along a value if it's non-zero.
storage/experimental/experimental.go
Outdated
"google.golang.org/api/option" | ||
) | ||
|
||
// WithMetricInterval provides a [ClientOption] that may be passed to [storage.NewGrpcClient]. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
typo: should be storage.NewGRPCClient (here and below)
storage/experimental/experimental.go
Outdated
// WithMetricInterval provides a [ClientOption] that may be passed to [storage.NewGrpcClient]. | ||
// It sets how often to emit metrics when using NewPeriodicReader and must be | ||
// greater than 1 minute. | ||
// https://pkg.go.dev/go.opentelemetry.io/otel/sdk/metric#NewPeriodicReader |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
leave an empty line (with a //
only) between links if you want them to not wrap in the godoc.
storage/experimental/experimental.go
Outdated
|
||
// WithMetricExporter provides a [ClientOption] that may be passed to [storage.NewGrpcClient]. | ||
// Set an alternate client-side metric Exporter to emit metrics through. | ||
// Must implement interface metric.Exporter: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just do [metric.Exporter] and the godoc should autolink.
storage/option.go
Outdated
@@ -15,12 +15,14 @@ | |||
package storage | |||
|
|||
import ( | |||
"time" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not sure why this got moved but it will probably break formatting presubmits
storage/experimental/experimental.go
Outdated
"google.golang.org/api/option" | ||
) | ||
|
||
// WithMetricInterval provides a [ClientOption] that may be passed to [storage.NewGrpcClient]. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: what does ClientOption link to?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
One more doc comment, otherwise LGTM
// WithReadStallTimeout provides a [ClientOption] that may be passed to [storage.NewClient]. | ||
// WithMetricInterval provides a [option.ClientOption] that may be passed to [storage.NewGRPCClient]. | ||
// It sets how often to emit metrics [metric.WithInterval] when using | ||
// [metric.NewPeriodicReader] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think removing the minimum setting is good. Maybe suggest time.Minute or higher as an interval in the godoc if exporting to cloud monitoring.
No description provided.