@@ -164,6 +164,14 @@ public boolean isEnableExtendedTracing() {
164
164
"CloudSpannerOperation.ExecuteStreamingQuery" ,
165
165
Attributes .of (AttributeKey .stringKey ("db.statement" ), SELECT1_STATEMENT .getSql ()),
166
166
spans );
167
+ SpanData executeQuerySpan =
168
+ getSpan (
169
+ "CloudSpannerOperation.ExecuteStreamingQuery" ,
170
+ Attributes .of (
171
+ AttributeKey .stringKey ("db.statement" ), SELECT1_STATEMENT .getSql (),
172
+ AttributeKey .stringKey ("thread.name" ), Thread .currentThread ().getName ()),
173
+ spans );
174
+
167
175
assertParent (
168
176
"CloudSpannerJdbc.SingleUseTransaction" , "CloudSpanner.ReadOnlyTransaction" , spans );
169
177
assertParent (
@@ -190,6 +198,14 @@ public void testSingleUseQuery() {
190
198
"CloudSpannerOperation.ExecuteStreamingQuery" ,
191
199
Attributes .of (AttributeKey .stringKey ("db.statement" ), SELECT1_STATEMENT .getSql ()),
192
200
spans );
201
+ SpanData executeQuerySpan =
202
+ getSpan (
203
+ "CloudSpannerOperation.ExecuteStreamingQuery" ,
204
+ Attributes .of (
205
+ AttributeKey .stringKey ("db.statement" ), SELECT1_STATEMENT .getSql (),
206
+ AttributeKey .stringKey ("thread.name" ), Thread .currentThread ().getName ()),
207
+ spans );
208
+
193
209
assertParent (
194
210
"CloudSpannerJdbc.SingleUseTransaction" , "CloudSpanner.ReadOnlyTransaction" , spans );
195
211
assertParent (
@@ -222,6 +238,13 @@ public void testSingleUseUpdate() {
222
238
"CloudSpannerOperation.ExecuteUpdate" ,
223
239
Attributes .of (AttributeKey .stringKey ("db.statement" ), INSERT_STATEMENT .getSql ()),
224
240
spans );
241
+ SpanData executeQuerySpan =
242
+ getSpan (
243
+ "CloudSpannerOperation.ExecuteUpdate" ,
244
+ Attributes .of (
245
+ AttributeKey .stringKey ("db.statement" ), INSERT_STATEMENT .getSql (),
246
+ AttributeKey .stringKey ("thread.name" ), Thread .currentThread ().getName ()),
247
+ spans );
225
248
assertParent ("CloudSpanner.ReadWriteTransaction" , "CloudSpannerOperation.Commit" , spans );
226
249
}
227
250
@@ -244,6 +267,15 @@ public void testSingleUseBatchUpdate() {
244
267
AttributeKey .stringArrayKey ("db.statement" ),
245
268
ImmutableList .of (INSERT_STATEMENT .getSql (), INSERT_STATEMENT .getSql ())),
246
269
spans );
270
+ SpanData executeQuerySpan =
271
+ getSpan (
272
+ "CloudSpannerOperation.BatchUpdate" ,
273
+ Attributes .of (
274
+ AttributeKey .stringArrayKey ("db.statement" ),
275
+ ImmutableList .of (INSERT_STATEMENT .getSql (), INSERT_STATEMENT .getSql ())),
276
+ spans );
277
+ String threadName = executeQuerySpan .getAttributes ().get (AttributeKey .stringKey ("thread.name" ));
278
+ assertEquals (Thread .currentThread ().getName (), threadName );
247
279
assertContains ("CloudSpannerOperation.Commit" , spans );
248
280
249
281
assertParent (
0 commit comments