@@ -240,7 +240,6 @@ public String[] getValidValues() {
240240 static final boolean DEFAULT_RETURN_COMMIT_STATS = false ;
241241 static final boolean DEFAULT_LENIENT = false ;
242242 static final boolean DEFAULT_ROUTE_TO_LEADER = true ;
243- static final boolean DEFAULT_ENABLE_END_TO_END_TRACING = false ;
244243 static final boolean DEFAULT_DELAY_TRANSACTION_START_UNTIL_FIRST_WRITE = false ;
245244 static final boolean DEFAULT_KEEP_TRANSACTION_ALIVE = false ;
246245 static final boolean DEFAULT_TRACK_SESSION_LEAKS = true ;
@@ -251,6 +250,7 @@ public String[] getValidValues() {
251250 static final int DEFAULT_MAX_PARTITIONED_PARALLELISM = 1 ;
252251 static final Boolean DEFAULT_ENABLE_EXTENDED_TRACING = null ;
253252 static final Boolean DEFAULT_ENABLE_API_TRACING = null ;
253+ static final boolean DEFAULT_ENABLE_END_TO_END_TRACING = false ;
254254 static final boolean DEFAULT_AUTO_BATCH_DML = false ;
255255 static final long DEFAULT_AUTO_BATCH_DML_UPDATE_COUNT = 1L ;
256256 static final boolean DEFAULT_AUTO_BATCH_DML_UPDATE_COUNT_VERIFICATION = true ;
@@ -269,8 +269,6 @@ public String[] getValidValues() {
269269 /** Name of the 'routeToLeader' connection property. */
270270 public static final String ROUTE_TO_LEADER_PROPERTY_NAME = "routeToLeader" ;
271271 /** Name of the 'retry aborts internally' connection property. */
272- public static final String ENABLE_END_TO_END_TRACING_PROPERTY_NAME = "enableEndToEndTracing" ;
273-
274272 public static final String RETRY_ABORTS_INTERNALLY_PROPERTY_NAME = "retryAbortsInternally" ;
275273 /** Name of the property to enable/disable virtual threads for the statement executor. */
276274 public static final String USE_VIRTUAL_THREADS_PROPERTY_NAME = "useVirtualThreads" ;
@@ -339,6 +337,7 @@ public String[] getValidValues() {
339337
340338 public static final String ENABLE_EXTENDED_TRACING_PROPERTY_NAME = "enableExtendedTracing" ;
341339 public static final String ENABLE_API_TRACING_PROPERTY_NAME = "enableApiTracing" ;
340+ public static final String ENABLE_END_TO_END_TRACING_PROPERTY_NAME = "enableEndToEndTracing" ;
342341
343342 public static final String AUTO_BATCH_DML_PROPERTY_NAME = "auto_batch_dml" ;
344343 public static final String AUTO_BATCH_DML_UPDATE_COUNT_PROPERTY_NAME =
@@ -386,10 +385,6 @@ static boolean isEnableTransactionalConnectionStateForPostgreSQL() {
386385 ROUTE_TO_LEADER_PROPERTY_NAME ,
387386 "Should read/write transactions and partitioned DML be routed to leader region (true/false)" ,
388387 DEFAULT_ROUTE_TO_LEADER ),
389- ConnectionProperty .createBooleanProperty (
390- ENABLE_END_TO_END_TRACING_PROPERTY_NAME ,
391- "Should we enable end to end tracing (true/false)" ,
392- DEFAULT_ENABLE_END_TO_END_TRACING ),
393388 ConnectionProperty .createBooleanProperty (
394389 RETRY_ABORTS_INTERNALLY_PROPERTY_NAME ,
395390 "Should the connection automatically retry Aborted errors (true/false)" ,
@@ -545,7 +540,14 @@ static boolean isEnableTransactionalConnectionStateForPostgreSQL() {
545540 + "to get a detailed view of each RPC that is being executed by your application, "
546541 + "or if you want to debug potential latency problems caused by RPCs that are "
547542 + "being retried." ,
548- DEFAULT_ENABLE_API_TRACING ))));
543+ DEFAULT_ENABLE_API_TRACING ),
544+ ConnectionProperty .createBooleanProperty (
545+ ENABLE_END_TO_END_TRACING_PROPERTY_NAME ,
546+ "Enable end-to-end tracing (true/false) to generate traces for both the time "
547+ + "that is spent in the client, as well as time that is spent in the Spanner server. "
548+ + "Server side traces would always go to Google Cloud Trace so to see end to end traces, "
549+ + "client should choose an exporter that exports the traces to Google Cloud Trace." ,
550+ DEFAULT_ENABLE_END_TO_END_TRACING ))));
549551
550552 private static final Set <ConnectionProperty > INTERNAL_PROPERTIES =
551553 Collections .unmodifiableSet (
@@ -1213,8 +1215,10 @@ public boolean isRouteToLeader() {
12131215 return getInitialConnectionPropertyValue (ROUTE_TO_LEADER );
12141216 }
12151217
1216- /** Whether end-to-end tracing is enabled. */
1217- public boolean enableEndToEndTracing () {
1218+ /**
1219+ * Whether end-to-end tracing is enabled.
1220+ */
1221+ public boolean isEndToEndTracingEnabled () {
12181222 return getInitialConnectionPropertyValue (ENABLE_END_TO_END_TRACING );
12191223 }
12201224
0 commit comments