@@ -276,7 +276,11 @@ public Dataset createSkipExceptionTranslation(Dataset dataset, Map<Option, ?> op
276276 .getRequestHeaders ()
277277 .set ("x-goog-otel-enabled" , this .options .isOpenTelemetryTracingEnabled ());
278278
279- String destinationId = RESOURCE_PROJECT_PREFIX + dataset .getDatasetReference ().getProjectId () + "/datasets/" + dataset .getDatasetReference ().getDatasetId ();
279+ String destinationId =
280+ RESOURCE_PROJECT_PREFIX
281+ + dataset .getDatasetReference ().getProjectId ()
282+ + "/datasets/"
283+ + dataset .getDatasetReference ().getDatasetId ();
280284
281285 return executeWithSpan (
282286 createRpcTracingSpan (
@@ -334,8 +338,8 @@ public Table createSkipExceptionTranslation(Table table, Map<Option, ?> options)
334338 "com.google.cloud.bigquery.BigQueryRpc.createTable" ,
335339 "TableService" ,
336340 "InsertTable" ,
337- options ,
338- destinationId ),
341+ destinationId ,
342+ options ),
339343 span -> {
340344 Table tableResponse = bqCreateRequest .execute ();
341345 if (span != null ) {
@@ -370,7 +374,13 @@ public Routine createSkipExceptionTranslation(Routine routine, Map<Option, ?> op
370374 .getRequestHeaders ()
371375 .set ("x-goog-otel-enabled" , this .options .isOpenTelemetryTracingEnabled ());
372376
373- String destinationId = RESOURCE_PROJECT_PREFIX + reference .getProjectId () + "/datasets/" + reference .getDatasetId () + "/routines/" + reference .getRoutineId ();
377+ String destinationId =
378+ RESOURCE_PROJECT_PREFIX
379+ + reference .getProjectId ()
380+ + "/datasets/"
381+ + reference .getDatasetId ()
382+ + "/routines/"
383+ + reference .getRoutineId ();
374384
375385 return executeWithSpan (
376386 createRpcTracingSpan (
@@ -543,7 +553,11 @@ public Dataset patchSkipExceptionTranslation(Dataset dataset, Map<Option, ?> opt
543553 .getRequestHeaders ()
544554 .set ("x-goog-otel-enabled" , this .options .isOpenTelemetryTracingEnabled ());
545555
546- String destinationId = RESOURCE_PROJECT_PREFIX + reference .getProjectId () + "/datasets/" + reference .getDatasetId ();
556+ String destinationId =
557+ RESOURCE_PROJECT_PREFIX
558+ + reference .getProjectId ()
559+ + "/datasets/"
560+ + reference .getDatasetId ();
547561
548562 return executeWithSpan (
549563 createRpcTracingSpan (
@@ -590,7 +604,13 @@ public Table patchSkipExceptionTranslation(Table table, Map<Option, ?> options)
590604 .getRequestHeaders ()
591605 .set ("x-goog-otel-enabled" , this .options .isOpenTelemetryTracingEnabled ());
592606
593- String destinationId = RESOURCE_PROJECT_PREFIX + reference .getProjectId () + "/datasets/" + reference .getDatasetId () + "/tables/" + reference .getTableId ();
607+ String destinationId =
608+ RESOURCE_PROJECT_PREFIX
609+ + reference .getProjectId ()
610+ + "/datasets/"
611+ + reference .getDatasetId ()
612+ + "/tables/"
613+ + reference .getTableId ();
594614
595615 return executeWithSpan (
596616 createRpcTracingSpan (
@@ -639,7 +659,8 @@ public Table getTableSkipExceptionTranslation(
639659 .getRequestHeaders ()
640660 .set ("x-goog-otel-enabled" , this .options .isOpenTelemetryTracingEnabled ());
641661
642- String destinationId = RESOURCE_PROJECT_PREFIX + projectId + "/datasets/" + datasetId + "/tables/" + tableId ;
662+ String destinationId =
663+ RESOURCE_PROJECT_PREFIX + projectId + "/datasets/" + datasetId + "/tables/" + tableId ;
643664
644665 return executeWithSpan (
645666 createRpcTracingSpan (
@@ -690,7 +711,8 @@ public Tuple<String, Iterable<Table>> listTablesSkipExceptionTranslation(
690711 .getRequestHeaders ()
691712 .set ("x-goog-otel-enabled" , this .options .isOpenTelemetryTracingEnabled ());
692713
693- String destinationId = RESOURCE_PROJECT_PREFIX + projectId + "/datasets/" + datasetId + "/tables" ;
714+ String destinationId =
715+ RESOURCE_PROJECT_PREFIX + projectId + "/datasets/" + datasetId + "/tables" ;
694716
695717 return executeWithSpan (
696718 createRpcTracingSpan (
@@ -756,7 +778,8 @@ public boolean deleteTableSkipExceptionTranslation(
756778 .getRequestHeaders ()
757779 .set ("x-goog-otel-enabled" , this .options .isOpenTelemetryTracingEnabled ());
758780
759- String destinationId = RESOURCE_PROJECT_PREFIX + projectId + "/datasets/" + datasetId + "/tables/" + tableId ;
781+ String destinationId =
782+ RESOURCE_PROJECT_PREFIX + projectId + "/datasets/" + datasetId + "/tables/" + tableId ;
760783
761784 return executeWithSpan (
762785 createRpcTracingSpan (
@@ -798,7 +821,13 @@ public Model patchSkipExceptionTranslation(Model model, Map<Option, ?> options)
798821 .getRequestHeaders ()
799822 .set ("x-goog-otel-enabled" , this .options .isOpenTelemetryTracingEnabled ());
800823
801- String destinationId = RESOURCE_PROJECT_PREFIX + reference .getProjectId () + "/datasets/" + reference .getDatasetId () + "/models/" + reference .getModelId ();
824+ String destinationId =
825+ RESOURCE_PROJECT_PREFIX
826+ + reference .getProjectId ()
827+ + "/datasets/"
828+ + reference .getDatasetId ()
829+ + "/models/"
830+ + reference .getModelId ();
802831
803832 return executeWithSpan (
804833 createRpcTracingSpan (
@@ -847,7 +876,8 @@ public Model getModelSkipExceptionTranslation(
847876 .getRequestHeaders ()
848877 .set ("x-goog-otel-enabled" , this .options .isOpenTelemetryTracingEnabled ());
849878
850- String destinationId = RESOURCE_PROJECT_PREFIX + projectId + "/datasets/" + datasetId + "/models/" + modelId ;
879+ String destinationId =
880+ RESOURCE_PROJECT_PREFIX + projectId + "/datasets/" + datasetId + "/models/" + modelId ;
851881
852882 return executeWithSpan (
853883 createRpcTracingSpan (
@@ -892,7 +922,8 @@ public Tuple<String, Iterable<Model>> listModelsSkipExceptionTranslation(
892922 .getRequestHeaders ()
893923 .set ("x-goog-otel-enabled" , this .options .isOpenTelemetryTracingEnabled ());
894924
895- String destinationId = RESOURCE_PROJECT_PREFIX + projectId + "/datasets/" + datasetId + "/models" ;
925+ String destinationId =
926+ RESOURCE_PROJECT_PREFIX + projectId + "/datasets/" + datasetId + "/models" ;
896927
897928 return executeWithSpan (
898929 createRpcTracingSpan (
@@ -942,7 +973,8 @@ public boolean deleteModelSkipExceptionTranslation(
942973 .getRequestHeaders ()
943974 .set ("x-goog-otel-enabled" , this .options .isOpenTelemetryTracingEnabled ());
944975
945- String destinationId = RESOURCE_PROJECT_PREFIX + projectId + "/datasets/" + datasetId + "/models/" + modelId ;
976+ String destinationId =
977+ RESOURCE_PROJECT_PREFIX + projectId + "/datasets/" + datasetId + "/models/" + modelId ;
946978
947979 return executeWithSpan (
948980 createRpcTracingSpan (
@@ -986,7 +1018,13 @@ public Routine updateSkipExceptionTranslation(Routine routine, Map<Option, ?> op
9861018 .getRequestHeaders ()
9871019 .set ("x-goog-otel-enabled" , this .options .isOpenTelemetryTracingEnabled ());
9881020
989- String destinationId = RESOURCE_PROJECT_PREFIX + reference .getProjectId () + "/datasets/" + reference .getDatasetId () + "/routines/" + reference .getRoutineId ();
1021+ String destinationId =
1022+ RESOURCE_PROJECT_PREFIX
1023+ + reference .getProjectId ()
1024+ + "/datasets/"
1025+ + reference .getDatasetId ()
1026+ + "/routines/"
1027+ + reference .getRoutineId ();
9901028
9911029 return executeWithSpan (
9921030 createRpcTracingSpan (
@@ -1035,7 +1073,8 @@ public Routine getRoutineSkipExceptionTranslation(
10351073 .getRequestHeaders ()
10361074 .set ("x-goog-otel-enabled" , this .options .isOpenTelemetryTracingEnabled ());
10371075
1038- String destinationId = RESOURCE_PROJECT_PREFIX + projectId + "/datasets/" + datasetId + "/routines/" + routineId ;
1076+ String destinationId =
1077+ RESOURCE_PROJECT_PREFIX + projectId + "/datasets/" + datasetId + "/routines/" + routineId ;
10391078
10401079 return executeWithSpan (
10411080 createRpcTracingSpan (
@@ -1080,7 +1119,8 @@ public Tuple<String, Iterable<Routine>> listRoutinesSkipExceptionTranslation(
10801119 .getRequestHeaders ()
10811120 .set ("x-goog-otel-enabled" , this .options .isOpenTelemetryTracingEnabled ());
10821121
1083- String destinationId = RESOURCE_PROJECT_PREFIX + projectId + "/datasets/" + datasetId + "/routines" ;
1122+ String destinationId =
1123+ RESOURCE_PROJECT_PREFIX + projectId + "/datasets/" + datasetId + "/routines" ;
10841124
10851125 return executeWithSpan (
10861126 createRpcTracingSpan (
@@ -1129,7 +1169,8 @@ public boolean deleteRoutineSkipExceptionTranslation(
11291169 .getRequestHeaders ()
11301170 .set ("x-goog-otel-enabled" , this .options .isOpenTelemetryTracingEnabled ());
11311171
1132- String destinationId = RESOURCE_PROJECT_PREFIX + projectId + "/datasets/" + datasetId + "/routines/" + routineId ;
1172+ String destinationId =
1173+ RESOURCE_PROJECT_PREFIX + projectId + "/datasets/" + datasetId + "/routines/" + routineId ;
11331174
11341175 return executeWithSpan (
11351176 createRpcTracingSpan (
@@ -1169,7 +1210,8 @@ public TableDataInsertAllResponse insertAllSkipExceptionTranslation(
11691210 .getRequestHeaders ()
11701211 .set ("x-goog-otel-enabled" , this .options .isOpenTelemetryTracingEnabled ());
11711212
1172- String destinationId = RESOURCE_PROJECT_PREFIX + projectId + "/datasets/" + datasetId + "/tables/" + tableId ;
1213+ String destinationId =
1214+ RESOURCE_PROJECT_PREFIX + projectId + "/datasets/" + datasetId + "/tables/" + tableId ;
11731215
11741216 return executeWithSpan (
11751217 createRpcTracingSpan (
@@ -1212,7 +1254,8 @@ public TableDataList listTableDataSkipExceptionTranslation(
12121254 .getRequestHeaders ()
12131255 .set ("x-goog-otel-enabled" , this .options .isOpenTelemetryTracingEnabled ());
12141256
1215- String destinationId = RESOURCE_PROJECT_PREFIX + projectId + "/datasets/" + datasetId + "/tables/" + tableId ;
1257+ String destinationId =
1258+ RESOURCE_PROJECT_PREFIX + projectId + "/datasets/" + datasetId + "/tables/" + tableId ;
12161259
12171260 return executeWithSpan (
12181261 createRpcTracingSpan (
@@ -1265,7 +1308,8 @@ public TableDataList listTableDataWithRowLimitSkipExceptionTranslation(
12651308 .getRequestHeaders ()
12661309 .set ("x-goog-otel-enabled" , this .options .isOpenTelemetryTracingEnabled ());
12671310
1268- String destinationId = RESOURCE_PROJECT_PREFIX + projectId + "/datasets/" + datasetId + "/tables/" + tableId ;
1311+ String destinationId =
1312+ RESOURCE_PROJECT_PREFIX + projectId + "/datasets/" + datasetId + "/tables/" + tableId ;
12691313
12701314 return executeWithSpan (
12711315 createRpcTracingSpan (
@@ -1490,8 +1534,8 @@ public boolean cancelSkipExceptionTranslation(String projectId, String jobId, St
14901534 "com.google.cloud.bigquery.BigQueryRpc.cancelJob" ,
14911535 "JobService" ,
14921536 "CancelJob" ,
1493- null ,
1494- destinationId ),
1537+ destinationId ,
1538+ null ),
14951539 span -> {
14961540 bqCancelRequest .execute ();
14971541 return true ;
@@ -1525,8 +1569,8 @@ public boolean deleteJobSkipExceptionTranslation(
15251569 "com.google.cloud.bigquery.BigQueryRpc.deleteJob" ,
15261570 "JobService" ,
15271571 "DeleteJob" ,
1528- null ,
1529- destinationId ),
1572+ destinationId ,
1573+ null ),
15301574 span -> {
15311575 bqDeleteRequest .execute ();
15321576 return true ;
@@ -1572,8 +1616,8 @@ public GetQueryResultsResponse getQueryResultsSkipExceptionTranslation(
15721616 "com.google.cloud.bigquery.BigQueryRpc.getQueryResults" ,
15731617 "JobService" ,
15741618 "GetQueryResults" ,
1575- options ,
1576- destinationId ),
1619+ destinationId ,
1620+ options ),
15771621 span -> {
15781622 if (span != null ) {
15791623 span .setAttribute ("bq.rpc.page_token" , queryRequest .getPageToken ());
@@ -1618,8 +1662,8 @@ public GetQueryResultsResponse getQueryResultsWithRowLimitSkipExceptionTranslati
16181662 "com.google.cloud.bigquery.BigQueryRpc.getQueryResultsWithRowLimit" ,
16191663 "JobService" ,
16201664 "GetQueryResults" ,
1621- null ,
1622- destinationId ),
1665+ destinationId ,
1666+ null ),
16231667 span -> {
16241668 if (span != null ) {
16251669 span .setAttribute ("bq.rpc.page_token" , queryRequest .getPageToken ());
@@ -1653,8 +1697,8 @@ public QueryResponse queryRpcSkipExceptionTranslation(String projectId, QueryReq
16531697 "com.google.cloud.bigquery.BigQueryRpc.queryRpc" ,
16541698 "JobService" ,
16551699 "Query" ,
1656- null ,
1657- destinationId ),
1700+ destinationId ,
1701+ null ),
16581702 span -> {
16591703 return queryRequest .execute ();
16601704 });
@@ -1783,8 +1827,8 @@ public Policy getIamPolicySkipExceptionTranslation(String resourceId, Map<Option
17831827 "com.google.cloud.bigquery.BigQueryRpc.getIamPolicy" ,
17841828 "TableService" ,
17851829 "GetIamPolicy" ,
1786- options ,
1787- destinationId ),
1830+ destinationId ,
1831+ options ),
17881832 span -> {
17891833 return bqGetRequest .execute ();
17901834 });
@@ -1818,8 +1862,8 @@ public Policy setIamPolicySkipExceptionTranslation(
18181862 "com.google.cloud.bigquery.BigQueryRpc.setIamPolicy" ,
18191863 "TableService" ,
18201864 "SetIamPolicy" ,
1821- options ,
1822- destinationId ),
1865+ destinationId ,
1866+ options ),
18231867 span -> {
18241868 return bqSetRequest .execute ();
18251869 });
@@ -1854,8 +1898,8 @@ public TestIamPermissionsResponse testIamPermissionsSkipExceptionTranslation(
18541898 "com.google.cloud.bigquery.BigQueryRpc.testIamPermissions" ,
18551899 "TableService" ,
18561900 "TestIamPermissions" ,
1857- options ,
1858- destinationId ),
1901+ destinationId ,
1902+ options ),
18591903 span -> {
18601904 return bqTestRequest .execute ();
18611905 });
@@ -1868,11 +1912,15 @@ public TestIamPermissionsResponse testIamPermissionsSkipExceptionTranslation(
18681912 */
18691913 private Span createRpcTracingSpan (
18701914 String spanName , String service , String method , Map <Option , ?> options ) {
1871- return createRpcTracingSpan (spanName , service , method , options , null );
1915+ return createRpcTracingSpan (spanName , service , method , null , options );
18721916 }
18731917
18741918 private Span createRpcTracingSpan (
1875- String spanName , String service , String method , Map <Option , ?> options , String destinationId ) {
1919+ String spanName ,
1920+ String service ,
1921+ String method ,
1922+ String destinationId ,
1923+ Map <Option , ?> options ) {
18761924 if (!this .options .isOpenTelemetryTracingEnabled ()
18771925 || this .options .getOpenTelemetryTracer () == null ) {
18781926 return null ;
@@ -1885,11 +1933,9 @@ private Span createRpcTracingSpan(
18851933 .setSpanKind (SpanKind .CLIENT )
18861934 .setAttribute ("bq.rpc.service" , service )
18871935 .setAttribute ("bq.rpc.method" , method )
1888- .setAttribute ("bq.rpc.system" , "http" );
1936+ .setAttribute ("bq.rpc.system" , "http" )
1937+ .setAttribute (BigQueryTelemetryTracer .GCP_DESTINATION_ID , destinationId );
18891938
1890- if (destinationId != null ) {
1891- builder .setAttribute (BigQueryTelemetryTracer .GCP_DESTINATION_ID , destinationId );
1892- }
18931939 if (options != null ) {
18941940 builder .setAllAttributes (otelAttributesFromOptions (options ));
18951941 }
0 commit comments