public class BigQuerySinkMetrics
extends java.lang.Object
In general metrics be in the namespace 'BigQuerySink' and have their name formatted as:
'{baseName}*{metricLabelKey1}:{metricLabelVal1};...{metricLabelKeyN}:{metricLabelValN};'
Modifier and Type | Class and Description |
---|---|
static class |
BigQuerySinkMetrics.ParsedMetricName |
static class |
BigQuerySinkMetrics.RpcMethod |
Modifier and Type | Field and Description |
---|---|
static java.lang.String |
METRICS_NAMESPACE |
static java.lang.String |
OK |
static java.lang.String |
PAYLOAD_TOO_LARGE |
static java.lang.String |
THROTTLED_TIME |
Constructor and Description |
---|
BigQuerySinkMetrics() |
Modifier and Type | Method and Description |
---|---|
static Counter |
appendRowsRowStatusCounter(org.apache.beam.sdk.io.gcp.bigquery.BigQuerySinkMetrics.RowStatus rowStatus,
java.lang.String rpcStatus,
java.lang.String tableId) |
static java.util.Optional<BigQuerySinkMetrics.ParsedMetricName> |
parseMetricName(java.lang.String metricName)
Parse a 'metric name' String that was created with 'createLabeledMetricName'.
|
static void |
reportFailedRPCMetrics(org.apache.beam.sdk.io.gcp.bigquery.RetryManager.Operation.Context<?> c,
BigQuerySinkMetrics.RpcMethod method)
Records RpcRequests counter and RpcLatency histogram for this RPC call.
|
static void |
reportFailedRPCMetrics(org.apache.beam.sdk.io.gcp.bigquery.RetryManager.Operation.Context<?> c,
BigQuerySinkMetrics.RpcMethod method,
java.lang.String tableId)
Records RpcRequests counter and RpcLatency histogram for this RPC call.
|
static void |
reportSuccessfulRpcMetrics(org.apache.beam.sdk.io.gcp.bigquery.RetryManager.Operation.Context<?> c,
BigQuerySinkMetrics.RpcMethod method)
Records RpcRequests counter and RpcLatency histogram for this RPC call.
|
static void |
reportSuccessfulRpcMetrics(org.apache.beam.sdk.io.gcp.bigquery.RetryManager.Operation.Context<?> c,
BigQuerySinkMetrics.RpcMethod method,
java.lang.String tableId)
Records RpcRequests counter and RpcLatency histogram for this RPC call.
|
static void |
setSupportMetricsDeletion(boolean supportMetricsDeletion) |
static Counter |
throttledTimeCounter(BigQuerySinkMetrics.RpcMethod method) |
static java.lang.String |
throwableToGRPCCodeString(java.lang.Throwable t)
Converts a Throwable to a gRPC Status code.
|
public static final java.lang.String METRICS_NAMESPACE
public static final java.lang.String OK
public static final java.lang.String PAYLOAD_TOO_LARGE
public static final java.lang.String THROTTLED_TIME
public static java.util.Optional<BigQuerySinkMetrics.ParsedMetricName> parseMetricName(java.lang.String metricName)
'{baseName}*{metricLabelKey1}:{metricLabelVal1};...{metricLabelKeyN}:{metricLabelValN};'
metricName
- public static Counter appendRowsRowStatusCounter(org.apache.beam.sdk.io.gcp.bigquery.BigQuerySinkMetrics.RowStatus rowStatus, java.lang.String rpcStatus, java.lang.String tableId)
rowStatus
- Status of these BigQuery rows.rpcStatus
- rpcStatustableId
- Table pertaining to the write method. Only included in the metric key if
'supportsMetricsDeletion' is enabled.public static Counter throttledTimeCounter(BigQuerySinkMetrics.RpcMethod method)
method
- StorageWriteAPI write method.public static java.lang.String throwableToGRPCCodeString(@Nullable java.lang.Throwable t)
t
- Throwable.public static void reportSuccessfulRpcMetrics(@Nullable org.apache.beam.sdk.io.gcp.bigquery.RetryManager.Operation.Context<?> c, BigQuerySinkMetrics.RpcMethod method)
UNKNOWN
. RpcRequets counter will have RpcStatus label set to OK
.c
- Context of successful RPC call.method
- StorageWriteAPI method associated with this metric.public static void reportSuccessfulRpcMetrics(@Nullable org.apache.beam.sdk.io.gcp.bigquery.RetryManager.Operation.Context<?> c, BigQuerySinkMetrics.RpcMethod method, java.lang.String tableId)
OK
.c
- Context of successful RPC call.method
- StorageWriteAPI method associated with this metric.tableId
- Table pertaining to the write method. Only included in the metric key if
'supportsMetricsDeletion' is enabled.public static void reportFailedRPCMetrics(@Nullable org.apache.beam.sdk.io.gcp.bigquery.RetryManager.Operation.Context<?> c, BigQuerySinkMetrics.RpcMethod method)
UNKNOWN
. RpcRequets counter will have a RpcStatus label set from the gRPC error.c
- Context of successful RPC call.method
- StorageWriteAPI method associated with this metric.public static void reportFailedRPCMetrics(@Nullable org.apache.beam.sdk.io.gcp.bigquery.RetryManager.Operation.Context<?> c, BigQuerySinkMetrics.RpcMethod method, java.lang.String tableId)
c
- Context of successful RPC call.method
- StorageWriteAPI method associated with this metric.tableId
- Table pertaining to the write method. Only included in the metric key if
'supportsMetricsDeletion' is enabled.public static void setSupportMetricsDeletion(boolean supportMetricsDeletion)