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: Define the metrics for collecting per connection error count. #2088

Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
Expand Up @@ -29,6 +29,20 @@ class BuiltinMeasureConstants {
static final TagKey ZONE = TagKey.create("zone");
static final TagKey CLIENT_UID = TagKey.create("client_uid");

// Monitored resource TagKeys for gce_instance
static final TagKey GCE_PROJECT_ID = TagKey.create("gce_project_id");
rkaregar marked this conversation as resolved.
Show resolved Hide resolved
static final TagKey GCE_INSTANCE_ID = TagKey.create("gce_instance_id");
static final TagKey GCE_ZONE = TagKey.create("gce_zone");

// Monitored resource TagKeys for gke_container
static final TagKey GKE_PROJECT_ID = TagKey.create("gke_project_id");
static final TagKey GKE_CLUSTER_NAME = TagKey.create("gke_cluster_name");
static final TagKey GKE_NAMESPACE_ID = TagKey.create("gke_namespace_id");
static final TagKey GKE_INSTANCE_ID = TagKey.create("gke_instance_id");
static final TagKey GKE_POD_ID = TagKey.create("gke_pod_id");
static final TagKey GKE_CONTAINER_NAME = TagKey.create("gke_container_name");
static final TagKey GKE_ZONE = TagKey.create("gke_zone");

// Metrics TagKeys
static final TagKey APP_PROFILE = TagKey.create("app_profile");
static final TagKey METHOD = TagKey.create("method");
Expand Down Expand Up @@ -88,4 +102,10 @@ class BuiltinMeasureConstants {
"bigtable.googleapis.com/internal/client/throttling_latencies",
"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.",
MILLISECOND);

static final MeasureLong PER_CONNECTION_ERROR_COUNT =
MeasureLong.create(
"bigtable.googleapis.com/internal/client/per_connection_error_count",
"Distribution of counts of channels per 'error count per minute'.",
COUNT);
}
Expand Up @@ -15,24 +15,7 @@
*/
package com.google.cloud.bigtable.stats;

import static com.google.cloud.bigtable.stats.BuiltinMeasureConstants.APPLICATION_LATENCIES;
import static com.google.cloud.bigtable.stats.BuiltinMeasureConstants.APP_PROFILE;
import static com.google.cloud.bigtable.stats.BuiltinMeasureConstants.ATTEMPT_LATENCIES;
import static com.google.cloud.bigtable.stats.BuiltinMeasureConstants.CLIENT_NAME;
import static com.google.cloud.bigtable.stats.BuiltinMeasureConstants.CLUSTER;
import static com.google.cloud.bigtable.stats.BuiltinMeasureConstants.CONNECTIVITY_ERROR_COUNT;
import static com.google.cloud.bigtable.stats.BuiltinMeasureConstants.FIRST_RESPONSE_LATENCIES;
import static com.google.cloud.bigtable.stats.BuiltinMeasureConstants.INSTANCE_ID;
import static com.google.cloud.bigtable.stats.BuiltinMeasureConstants.METHOD;
import static com.google.cloud.bigtable.stats.BuiltinMeasureConstants.OPERATION_LATENCIES;
import static com.google.cloud.bigtable.stats.BuiltinMeasureConstants.PROJECT_ID;
import static com.google.cloud.bigtable.stats.BuiltinMeasureConstants.RETRY_COUNT;
import static com.google.cloud.bigtable.stats.BuiltinMeasureConstants.SERVER_LATENCIES;
import static com.google.cloud.bigtable.stats.BuiltinMeasureConstants.STATUS;
import static com.google.cloud.bigtable.stats.BuiltinMeasureConstants.STREAMING;
import static com.google.cloud.bigtable.stats.BuiltinMeasureConstants.TABLE;
import static com.google.cloud.bigtable.stats.BuiltinMeasureConstants.THROTTLING_LATENCIES;
import static com.google.cloud.bigtable.stats.BuiltinMeasureConstants.ZONE;
import static com.google.cloud.bigtable.stats.BuiltinMeasureConstants.*;
import static io.opencensus.stats.Aggregation.Distribution;
import static io.opencensus.stats.Aggregation.Sum;

Expand All @@ -59,6 +42,13 @@ class BuiltinViewConstants {
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,
100.0)));

private static final Aggregation PER_CONNECTION_ERROR_COUNT_AGGREGATION =
mutianf marked this conversation as resolved.
Show resolved Hide resolved
Distribution.create(
BucketBoundaries.create(
ImmutableList.of(
1.0, 2.0, 4.0, 8.0, 16.0, 32.0, 64.0, 128.0, 256.0, 512.0, 1024.0, 2048.0, 4096.0,
8192.0, 16384.0, 32768.0)));

private static final Aggregation AGGREGATION_COUNT = Sum.create();

static final View OPERATION_LATENCIES_VIEW =
Expand Down Expand Up @@ -183,4 +173,29 @@ class BuiltinViewConstants {
AGGREGATION_WITH_MILLIS_HISTOGRAM,
ImmutableList.of(
PROJECT_ID, INSTANCE_ID, APP_PROFILE, METHOD, CLIENT_NAME, CLUSTER, ZONE, TABLE));

static final View PER_CONNECTION_ERROR_COUNT_VIEW =
View.create(
View.Name.create("bigtable.googleapis.com/internal/client/per_connection_error_count"),
"Distribution of counts of channels per 'error count per minute'.",
PER_CONNECTION_ERROR_COUNT,
PER_CONNECTION_ERROR_COUNT_AGGREGATION,
ImmutableList.of(
rkaregar marked this conversation as resolved.
Show resolved Hide resolved
// Metric TagKeys
PROJECT_ID,
INSTANCE_ID,
APP_PROFILE,
CLIENT_NAME,
// gce_instance TagKeys
GCE_PROJECT_ID,
GCE_INSTANCE_ID,
GCE_ZONE,
// gke_container TagKeys
GKE_PROJECT_ID,
GKE_CLUSTER_NAME,
GKE_NAMESPACE_ID,
GKE_INSTANCE_ID,
GKE_POD_ID,
GKE_CONTAINER_NAME,
GKE_ZONE));
}