-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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): Client side merics #10046
feat(bigtable): Client side merics #10046
Conversation
4ddb6fb
to
072ae5d
Compare
🤖 I detect that the PR title and the commit message differ and there's only one commit. To use the PR title for the commit history, you can use Github's automerge feature with squashing, or use -- conventional-commit-lint bot |
072ae5d
to
4d85153
Compare
19a434d
to
536c4c9
Compare
0a65527
to
78f3d9e
Compare
4f51c17
to
e6c4fd6
Compare
a514461
to
0accc87
Compare
|
||
clientName = fmt.Sprintf("go-bigtable/%v", internal.Version) | ||
|
||
bucketBounds = []float64{0.0, 1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 8.0, 10.0, 13.0, 16.0, 20.0, 25.0, 30.0, 40.0, |
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.
Could you add a comment here explaining what this variable means and why the array of float values are what they are?
return tracerFactory, err | ||
} | ||
|
||
func builtInMeterProviderOptions(project string) ([]sdkmetric.Option, error) { |
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.
Could you rename this function and change the builtIn
part to something more specific to what it does?
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.
Changed MeterProviderOptions
in #10629
// builtinMetricsTracer is created one per operation | ||
// It is used to store metric instruments, attribute values | ||
// and other data required to obtain and record them | ||
type builtinMetricsTracer struct { |
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.
There are three different tracers in this file. Could you rename builtinMetricsTracer
to something that differentiates it from opTracer
and attemptTracer
?
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.
LGTM bigtable side
This PR adds support for built-in client side metrics in Go Bigtable client. Metrics will be recorded and exported by default to GCM if not opted out by user.
Major changes in this PR:
MetricsProvider
has been added. It can be used to opt out of metrics collection.MetricsProvider
option in config, a new meter provider is created with GCM exporter to record and export built-in metrics.NoopMetricsProvider
in config, metrics will neither be recorded, nor be exportedDuring client creation, a new metricsTracerFactory instance will be created, then OTel (Open Telemetry) instruments will be created on meter provider and these instruments will be saved to metricsTracerFactory.
Whenever any operation is invoked on data client such as ReadRows, a new builtinMetricsTracer will be created using the metricsTracerFactory
bigtable/metric_monitoring_exporter.go file is the GCM (Google Cloud Monitoring) exporter. The code in this file is a modified version ( diff ) of https://github.com/GoogleCloudPlatform/opentelemetry-operations-go/blob/88c799af8373802d659e6efdca387e3a353e8c21/exporter/metric/metric.go :
All the data methods have been modified to include attempt recorder and operation recorder.
Out of all the metrics, this PR adds operation_latencies, attempt_latencies, server_latencies and retry_count. Rest will be added in follow up PRs
Below diagram shows code flow when client is created using NewClient method: