|
26 | 26 | import static com.google.cloud.spanner.connection.ConnectionProperties.DATA_BOOST_ENABLED;
|
27 | 27 | import static com.google.cloud.spanner.connection.ConnectionProperties.DIALECT;
|
28 | 28 | import static com.google.cloud.spanner.connection.ConnectionProperties.ENABLE_API_TRACING;
|
| 29 | +import static com.google.cloud.spanner.connection.ConnectionProperties.ENABLE_END_TO_END_TRACING; |
29 | 30 | import static com.google.cloud.spanner.connection.ConnectionProperties.ENABLE_EXTENDED_TRACING;
|
30 | 31 | import static com.google.cloud.spanner.connection.ConnectionProperties.ENCODED_CREDENTIALS;
|
31 | 32 | import static com.google.cloud.spanner.connection.ConnectionProperties.ENDPOINT;
|
@@ -249,6 +250,7 @@ public String[] getValidValues() {
|
249 | 250 | static final int DEFAULT_MAX_PARTITIONED_PARALLELISM = 1;
|
250 | 251 | static final Boolean DEFAULT_ENABLE_EXTENDED_TRACING = null;
|
251 | 252 | static final Boolean DEFAULT_ENABLE_API_TRACING = null;
|
| 253 | + static final boolean DEFAULT_ENABLE_END_TO_END_TRACING = false; |
252 | 254 | static final boolean DEFAULT_AUTO_BATCH_DML = false;
|
253 | 255 | static final long DEFAULT_AUTO_BATCH_DML_UPDATE_COUNT = 1L;
|
254 | 256 | static final boolean DEFAULT_AUTO_BATCH_DML_UPDATE_COUNT_VERIFICATION = true;
|
@@ -335,6 +337,7 @@ public String[] getValidValues() {
|
335 | 337 |
|
336 | 338 | public static final String ENABLE_EXTENDED_TRACING_PROPERTY_NAME = "enableExtendedTracing";
|
337 | 339 | public static final String ENABLE_API_TRACING_PROPERTY_NAME = "enableApiTracing";
|
| 340 | + public static final String ENABLE_END_TO_END_TRACING_PROPERTY_NAME = "enableEndToEndTracing"; |
338 | 341 |
|
339 | 342 | public static final String AUTO_BATCH_DML_PROPERTY_NAME = "auto_batch_dml";
|
340 | 343 | public static final String AUTO_BATCH_DML_UPDATE_COUNT_PROPERTY_NAME =
|
@@ -537,7 +540,14 @@ static boolean isEnableTransactionalConnectionStateForPostgreSQL() {
|
537 | 540 | + "to get a detailed view of each RPC that is being executed by your application, "
|
538 | 541 | + "or if you want to debug potential latency problems caused by RPCs that are "
|
539 | 542 | + "being retried.",
|
540 |
| - 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 can only go to Google Cloud Trace, so to see end to end traces, " |
| 549 | + + "the application should configure an exporter that exports the traces to Google Cloud Trace.", |
| 550 | + DEFAULT_ENABLE_END_TO_END_TRACING)))); |
541 | 551 |
|
542 | 552 | private static final Set<ConnectionProperty> INTERNAL_PROPERTIES =
|
543 | 553 | Collections.unmodifiableSet(
|
@@ -1205,6 +1215,11 @@ public boolean isRouteToLeader() {
|
1205 | 1215 | return getInitialConnectionPropertyValue(ROUTE_TO_LEADER);
|
1206 | 1216 | }
|
1207 | 1217 |
|
| 1218 | + /** Whether end-to-end tracing is enabled. */ |
| 1219 | + public boolean isEndToEndTracingEnabled() { |
| 1220 | + return getInitialConnectionPropertyValue(ENABLE_END_TO_END_TRACING); |
| 1221 | + } |
| 1222 | + |
1208 | 1223 | /**
|
1209 | 1224 | * The initial retryAbortsInternally value for connections created by this {@link
|
1210 | 1225 | * ConnectionOptions}
|
|
0 commit comments