Class TelemetryManager (1.10.0)
Stay organized with collections
Save and categorize content based on your preferences.
1.10.0 (latest)
1.6.0
1.2.0
1.1.0
1.0.0
public final class TelemetryManager implements AutoCloseable
Thread-safe singleton hub managing the lifecycle of TelemetryBatcher for client-side
diagnostic and usage telemetry in the BigQuery JDBC driver.
All telemetry operations are wrapped in exception safeguards so that failures in metric
collection or batch dispatching never impact standard JDBC functionality.
Static Methods
closeInstance()
public static synchronized void closeInstance ()
Flushes pending buffered metrics and shuts down the shared instance.
public static int extractErrorCode ( Throwable t )
Extracts the numeric error code from the throwable chain. Traverses causes to unpack
BigQueryException (HTTP status codes) or SQLException error codes. Returns 1000 as the fallback
driver error code.
Returns
Type
Description
int
public static String extractSqlState ( Throwable t )
Extracts the SQLState from the throwable chain. SQLStates are five-character strings.
Returns empty String when no SQLState is present.
Returns
Type
Description
String
getInstance()
public static TelemetryManager getInstance ()
Initializes or replaces the shared TelemetryManager instance with default configuration
and transport.
getInstance(Properties properties)
public static TelemetryManager getInstance ( Properties properties )
isInitialized()
public static boolean isInitialized ()
Helper to check if an active instance is present and initialized.
recordConnectionAttempt(Status status, int errorCode, AuthenticationType authType)
public static void recordConnectionAttempt ( Status status , int errorCode , AuthenticationType authType )
recordError(int errorCode, String errorSqlState, String methodName)
public static void recordError ( int errorCode , String errorSqlState , String methodName )
Parameters
Name
Description
errorCode
int
errorSqlState
String
methodName
String
recordFeatureUsage(DriverFeature feature)
public static void recordFeatureUsage ( DriverFeature feature )
recordFeatureUsage(DriverFeature feature, String customFeatureName)
public static void recordFeatureUsage ( DriverFeature feature , String customFeatureName )
recordStatementExecution(StatementExecution.Builder statementExecutionBuilder, long durationMs)
public static void recordStatementExecution ( StatementExecution . Builder statementExecutionBuilder , long durationMs )
runSafely(Runnable action)
public static void runSafely ( Runnable action )
Executes a telemetry logging operation safely inside an exception-isolated block. Guaranteed to
catch all Throwable exceptions to protect JDBC driver operations.
Parameter
Name
Description
action
Runnable
toAuthenticationType(int oauthType)
public static AuthenticationType toAuthenticationType ( int oauthType )
Parameter
Name
Description
oauthType
int
toStatementType(JobStatistics.QueryStatistics.StatementType bqStatementType)
public static StatementType toStatementType ( JobStatistics . QueryStatistics . StatementType bqStatementType )
Parameter
Name
Description
bqStatementType
com.google.cloud.bigquery.JobStatistics.QueryStatistics.StatementType
Methods
close()
Except as otherwise noted, the content of this page is licensed under the Creative Commons Attribution 4.0 License , and code samples are licensed under the Apache 2.0 License . For details, see the Google Developers Site Policies . Java is a registered trademark of Oracle and/or its affiliates.
Last updated 2026-11-18 UTC.
[null,null,["Last updated 2026-11-18 UTC."],[],[]]