Skip to content

Commit b212bbf

Browse files
authored
feat: Define the metrics for collecting per connection error count. (#2088)
Thank you for opening a Pull Request! Before submitting your PR, there are a few things you can do to make sure it goes smoothly: - [ ] Make sure to open an issue as a [bug/issue](https://github.com/googleapis/java-bigtable/issues/new/choose) before writing your code! That way we can discuss the change, evaluate designs, and agree on the general idea - [ ] Ensure the tests and linter pass - [ ] Code coverage does not decrease (if any source code was changed) - [ ] Appropriate docs were updated (if necessary) - [ ] Rollback plan is reviewed and LGTMed Fixes #2087 ☕️ If you write sample code, please follow the [samples format]( https://github.com/GoogleCloudPlatform/java-docs-samples/blob/main/SAMPLE_FORMAT.md).
1 parent 2516a09 commit b212bbf

File tree

2 files changed

+41
-18
lines changed

2 files changed

+41
-18
lines changed

google-cloud-bigtable-stats/src/main/java/com/google/cloud/bigtable/stats/BuiltinMeasureConstants.java

+6
Original file line numberDiff line numberDiff line change
@@ -88,4 +88,10 @@ class BuiltinMeasureConstants {
8888
"bigtable.googleapis.com/internal/client/throttling_latencies",
8989
"The artificial latency introduced by the client to limit the number of outstanding requests. The publishing of the measurement will be delayed until the attempt trailers have been received.",
9090
MILLISECOND);
91+
92+
static final MeasureLong PER_CONNECTION_ERROR_COUNT =
93+
MeasureLong.create(
94+
"bigtable.googleapis.com/internal/client/per_connection_error_count",
95+
"Distribution of counts of channels per 'error count per minute'.",
96+
COUNT);
9197
}

google-cloud-bigtable-stats/src/main/java/com/google/cloud/bigtable/stats/BuiltinViewConstants.java

+35-18
Original file line numberDiff line numberDiff line change
@@ -15,24 +15,7 @@
1515
*/
1616
package com.google.cloud.bigtable.stats;
1717

18-
import static com.google.cloud.bigtable.stats.BuiltinMeasureConstants.APPLICATION_LATENCIES;
19-
import static com.google.cloud.bigtable.stats.BuiltinMeasureConstants.APP_PROFILE;
20-
import static com.google.cloud.bigtable.stats.BuiltinMeasureConstants.ATTEMPT_LATENCIES;
21-
import static com.google.cloud.bigtable.stats.BuiltinMeasureConstants.CLIENT_NAME;
22-
import static com.google.cloud.bigtable.stats.BuiltinMeasureConstants.CLUSTER;
23-
import static com.google.cloud.bigtable.stats.BuiltinMeasureConstants.CONNECTIVITY_ERROR_COUNT;
24-
import static com.google.cloud.bigtable.stats.BuiltinMeasureConstants.FIRST_RESPONSE_LATENCIES;
25-
import static com.google.cloud.bigtable.stats.BuiltinMeasureConstants.INSTANCE_ID;
26-
import static com.google.cloud.bigtable.stats.BuiltinMeasureConstants.METHOD;
27-
import static com.google.cloud.bigtable.stats.BuiltinMeasureConstants.OPERATION_LATENCIES;
28-
import static com.google.cloud.bigtable.stats.BuiltinMeasureConstants.PROJECT_ID;
29-
import static com.google.cloud.bigtable.stats.BuiltinMeasureConstants.RETRY_COUNT;
30-
import static com.google.cloud.bigtable.stats.BuiltinMeasureConstants.SERVER_LATENCIES;
31-
import static com.google.cloud.bigtable.stats.BuiltinMeasureConstants.STATUS;
32-
import static com.google.cloud.bigtable.stats.BuiltinMeasureConstants.STREAMING;
33-
import static com.google.cloud.bigtable.stats.BuiltinMeasureConstants.TABLE;
34-
import static com.google.cloud.bigtable.stats.BuiltinMeasureConstants.THROTTLING_LATENCIES;
35-
import static com.google.cloud.bigtable.stats.BuiltinMeasureConstants.ZONE;
18+
import static com.google.cloud.bigtable.stats.BuiltinMeasureConstants.*;
3619
import static io.opencensus.stats.Aggregation.Distribution;
3720
import static io.opencensus.stats.Aggregation.Sum;
3821

@@ -59,6 +42,32 @@ class BuiltinViewConstants {
5942
1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0, 9.0, 10.0, 15.0, 20.0, 30.0, 40.0, 50.0,
6043
100.0)));
6144

45+
private static final Aggregation PER_CONNECTION_ERROR_COUNT_AGGREGATION =
46+
Distribution.create(
47+
BucketBoundaries.create(
48+
ImmutableList.of(
49+
1.0,
50+
2.0,
51+
4.0,
52+
8.0,
53+
16.0,
54+
32.0,
55+
64.0,
56+
125.0,
57+
250.0,
58+
500.0,
59+
1_000.0,
60+
2_000.0,
61+
4_000.0,
62+
8_000.0,
63+
16_000.0,
64+
32_000.0,
65+
64_000.0,
66+
128_000.0,
67+
250_000.0,
68+
500_000.0,
69+
1_000_000.0)));
70+
6271
private static final Aggregation AGGREGATION_COUNT = Sum.create();
6372

6473
static final View OPERATION_LATENCIES_VIEW =
@@ -183,4 +192,12 @@ class BuiltinViewConstants {
183192
AGGREGATION_WITH_MILLIS_HISTOGRAM,
184193
ImmutableList.of(
185194
PROJECT_ID, INSTANCE_ID, APP_PROFILE, METHOD, CLIENT_NAME, CLUSTER, ZONE, TABLE));
195+
196+
static final View PER_CONNECTION_ERROR_COUNT_VIEW =
197+
View.create(
198+
View.Name.create("bigtable.googleapis.com/internal/client/per_connection_error_count"),
199+
"Distribution of counts of channels per 'error count per minute'.",
200+
PER_CONNECTION_ERROR_COUNT,
201+
PER_CONNECTION_ERROR_COUNT_AGGREGATION,
202+
ImmutableList.of(PROJECT_ID, INSTANCE_ID, APP_PROFILE, CLIENT_NAME));
186203
}

0 commit comments

Comments
 (0)