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(storage): add grpc metrics experimental options #10984

Merged
merged 18 commits into from
Oct 18, 2024
Merged

feat(storage): add grpc metrics experimental options #10984

merged 18 commits into from
Oct 18, 2024

Conversation

frankyn
Copy link
Member

@frankyn frankyn commented Oct 11, 2024

No description provided.

@product-auto-label product-auto-label bot added the api: storage Issues related to the Cloud Storage API. label Oct 11, 2024
@frankyn frankyn changed the title feat(storage): experimental options feat(storage): add experimental options Oct 11, 2024
@frankyn frankyn marked this pull request as ready for review October 11, 2024 20:49
@frankyn frankyn requested review from a team as code owners October 11, 2024 20:49
Copy link
Contributor

@tritone tritone left a 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!

"google.golang.org/api/option"
)

// WithMetricInterval how often to emit metrics when using NewPeriodicReader
Copy link
Contributor

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.

@tritone
Copy link
Contributor

tritone commented Oct 11, 2024

Also, looks like your unit test fails... can you investigate?

@frankyn frankyn requested a review from tritone October 15, 2024 16:28
@tritone tritone changed the title feat(storage): add experimental options feat(storage): add grpc metrics experimental options Oct 17, 2024
Copy link
Contributor

@tritone tritone left a 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

"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.
Copy link
Contributor

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.

Copy link
Member Author

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.

"google.golang.org/api/option"
)

// WithMetricInterval provides a [ClientOption] that may be passed to [storage.NewGrpcClient].
Copy link
Contributor

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)

// 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
Copy link
Contributor

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.


// 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:
Copy link
Contributor

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.

@@ -15,12 +15,14 @@
package storage

import (
"time"
Copy link
Contributor

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

"google.golang.org/api/option"
)

// WithMetricInterval provides a [ClientOption] that may be passed to [storage.NewGrpcClient].
Copy link
Contributor

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?

Copy link
Contributor

@tritone tritone left a 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]
Copy link
Contributor

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.

@frankyn frankyn enabled auto-merge (squash) October 18, 2024 14:24
@frankyn frankyn merged commit 5b7397b into main Oct 18, 2024
9 checks passed
@frankyn frankyn deleted the exp-options branch October 18, 2024 14:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
api: storage Issues related to the Cloud Storage API.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants