Skip to content

Commit 5c5fc73

Browse files
Replace assertEqualSpanInstrumentationInfo with assertEqualSpanInstrumentationScope (#3037)
* Replace assertInstInfo with assertInstScope * Update Changelog * Fix order of other changelog entries
1 parent d9e1448 commit 5c5fc73

File tree

18 files changed

+63
-61
lines changed

18 files changed

+63
-61
lines changed

Diff for: CHANGELOG.md

+4-2
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
2525
([#3027](https://github.com/open-telemetry/opentelemetry-python-contrib/pull/3027))
2626
- `opentelemetry-instrumentation-mysqlclient` Add sqlcommenter support
2727
([#2941](https://github.com/open-telemetry/opentelemetry-python-contrib/pull/2941))
28+
- `opentelemetry-instrumentation-pymysql` Add sqlcommenter support
29+
([#2942](https://github.com/open-telemetry/opentelemetry-python-contrib/pull/2942))
2830

2931
### Fixed
3032

@@ -34,6 +36,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
3436
([#3025](https://github.com/open-telemetry/opentelemetry-python-contrib/pull/3025))
3537
- `opentelemetry-instrumentation-httpx`: Check if mount transport is none before wrap it
3638
([#3022](https://github.com/open-telemetry/opentelemetry-python-contrib/pull/3022))
39+
- Replace all instrumentor unit test `assertEqualSpanInstrumentationInfo` calls with `assertEqualSpanInstrumentationScope` calls
40+
([#3037](https://github.com/open-telemetry/opentelemetry-python-contrib/pull/3037))
3741

3842
### Breaking changes
3943

@@ -58,8 +62,6 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
5862
([#2635](https://github.com/open-telemetry/opentelemetry-python-contrib/pull/2635))
5963
- `opentelemetry-instrumentation` Add support for string based dotted module paths in unwrap
6064
([#2919](https://github.com/open-telemetry/opentelemetry-python-contrib/pull/2919))
61-
- `opentelemetry-instrumentation-pymysql` Add sqlcommenter support
62-
([#2942](https://github.com/open-telemetry/opentelemetry-python-contrib/pull/2942))
6365

6466
### Fixed
6567

Diff for: instrumentation/opentelemetry-instrumentation-aiopg/tests/test_aiopg_integration.py

+4-4
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ def test_instrumentor_connect(self):
6767
span = spans_list[0]
6868

6969
# Check version and name in span's instrumentation info
70-
self.assertEqualSpanInstrumentationInfo(
70+
self.assertEqualSpanInstrumentationScope(
7171
span, opentelemetry.instrumentation.aiopg
7272
)
7373

@@ -96,7 +96,7 @@ async def _ctx_manager_connect():
9696
span = spans_list[0]
9797

9898
# Check version and name in span's instrumentation info
99-
self.assertEqualSpanInstrumentationInfo(
99+
self.assertEqualSpanInstrumentationScope(
100100
span, opentelemetry.instrumentation.aiopg
101101
)
102102

@@ -117,7 +117,7 @@ def test_instrumentor_create_pool(self):
117117
span = spans_list[0]
118118

119119
# Check version and name in span's instrumentation info
120-
self.assertEqualSpanInstrumentationInfo(
120+
self.assertEqualSpanInstrumentationScope(
121121
span, opentelemetry.instrumentation.aiopg
122122
)
123123

@@ -148,7 +148,7 @@ async def _ctx_manager_pool():
148148
span = spans_list[0]
149149

150150
# Check version and name in span's instrumentation info
151-
self.assertEqualSpanInstrumentationInfo(
151+
self.assertEqualSpanInstrumentationScope(
152152
span, opentelemetry.instrumentation.aiopg
153153
)
154154

Diff for: instrumentation/opentelemetry-instrumentation-cassandra/tests/test_cassandra_integration.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@ def test_instrumentor(
7878
span = spans_list[0]
7979

8080
# Check version and name in span's instrumentation info
81-
self.assertEqualSpanInstrumentationInfo(
81+
self.assertEqualSpanInstrumentationScope(
8282
span, opentelemetry.instrumentation.cassandra
8383
)
8484
self.assertEqual(span.name, "Cassandra")

Diff for: instrumentation/opentelemetry-instrumentation-elasticsearch/tests/test_elasticsearch.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -114,7 +114,7 @@ def test_instrumentor(self, request_mock):
114114
span = spans_list[0]
115115

116116
# Check version and name in span's instrumentation info
117-
self.assertEqualSpanInstrumentationInfo(
117+
self.assertEqualSpanInstrumentationScope(
118118
span, opentelemetry.instrumentation.elasticsearch
119119
)
120120

@@ -608,7 +608,7 @@ def test_bulk(self, request_mock):
608608
span = spans_list[0]
609609

610610
# Check version and name in span's instrumentation info
611-
self.assertEqualSpanInstrumentationInfo(
611+
self.assertEqualSpanInstrumentationScope(
612612
span, opentelemetry.instrumentation.elasticsearch
613613
)
614614

Diff for: instrumentation/opentelemetry-instrumentation-grpc/tests/test_aio_client_interceptor.py

+4-4
Original file line numberDiff line numberDiff line change
@@ -114,7 +114,7 @@ async def test_unary_unary(self):
114114
self.assertIs(span.kind, trace.SpanKind.CLIENT)
115115

116116
# Check version and name in span's instrumentation info
117-
self.assertEqualSpanInstrumentationInfo(
117+
self.assertEqualSpanInstrumentationScope(
118118
span, opentelemetry.instrumentation.grpc
119119
)
120120

@@ -142,7 +142,7 @@ async def test_unary_stream(self):
142142
self.assertIs(span.kind, trace.SpanKind.CLIENT)
143143

144144
# Check version and name in span's instrumentation info
145-
self.assertEqualSpanInstrumentationInfo(
145+
self.assertEqualSpanInstrumentationScope(
146146
span, opentelemetry.instrumentation.grpc
147147
)
148148

@@ -170,7 +170,7 @@ async def test_stream_unary(self):
170170
self.assertIs(span.kind, trace.SpanKind.CLIENT)
171171

172172
# Check version and name in span's instrumentation info
173-
self.assertEqualSpanInstrumentationInfo(
173+
self.assertEqualSpanInstrumentationScope(
174174
span, opentelemetry.instrumentation.grpc
175175
)
176176

@@ -200,7 +200,7 @@ async def test_stream_stream(self):
200200
self.assertIs(span.kind, trace.SpanKind.CLIENT)
201201

202202
# Check version and name in span's instrumentation info
203-
self.assertEqualSpanInstrumentationInfo(
203+
self.assertEqualSpanInstrumentationScope(
204204
span, opentelemetry.instrumentation.grpc
205205
)
206206

Diff for: instrumentation/opentelemetry-instrumentation-grpc/tests/test_aio_server_interceptor.py

+7-7
Original file line numberDiff line numberDiff line change
@@ -105,7 +105,7 @@ async def request(channel):
105105
self.assertIs(span.kind, trace.SpanKind.SERVER)
106106

107107
# Check version and name in span's instrumentation info
108-
self.assertEqualSpanInstrumentationInfo(
108+
self.assertEqualSpanInstrumentationScope(
109109
span, opentelemetry.instrumentation.grpc
110110
)
111111

@@ -164,7 +164,7 @@ async def request(channel):
164164
self.assertIs(span.kind, trace.SpanKind.SERVER)
165165

166166
# Check version and name in span's instrumentation info
167-
self.assertEqualSpanInstrumentationInfo(
167+
self.assertEqualSpanInstrumentationScope(
168168
span, opentelemetry.instrumentation.grpc
169169
)
170170

@@ -217,7 +217,7 @@ async def request(channel):
217217
self.assertIs(parent_span.kind, trace.SpanKind.SERVER)
218218

219219
# Check version and name in span's instrumentation info
220-
self.assertEqualSpanInstrumentationInfo(
220+
self.assertEqualSpanInstrumentationScope(
221221
parent_span, opentelemetry.instrumentation.grpc
222222
)
223223

@@ -263,7 +263,7 @@ async def request(channel):
263263
self.assertIs(span.kind, trace.SpanKind.SERVER)
264264

265265
# Check version and name in span's instrumentation info
266-
self.assertEqualSpanInstrumentationInfo(
266+
self.assertEqualSpanInstrumentationScope(
267267
span, opentelemetry.instrumentation.grpc
268268
)
269269

@@ -318,7 +318,7 @@ async def request(channel):
318318
self.assertIs(parent_span.kind, trace.SpanKind.SERVER)
319319

320320
# Check version and name in span's instrumentation info
321-
self.assertEqualSpanInstrumentationInfo(
321+
self.assertEqualSpanInstrumentationScope(
322322
parent_span, opentelemetry.instrumentation.grpc
323323
)
324324

@@ -514,7 +514,7 @@ async def request(channel):
514514
self.assertIs(span.kind, trace.SpanKind.SERVER)
515515

516516
# Check version and name in span's instrumentation info
517-
self.assertEqualSpanInstrumentationInfo(
517+
self.assertEqualSpanInstrumentationScope(
518518
span, opentelemetry.instrumentation.grpc
519519
)
520520

@@ -579,7 +579,7 @@ async def request(channel):
579579
self.assertIs(span.kind, trace.SpanKind.SERVER)
580580

581581
# Check version and name in span's instrumentation info
582-
self.assertEqualSpanInstrumentationInfo(
582+
self.assertEqualSpanInstrumentationScope(
583583
span, opentelemetry.instrumentation.grpc
584584
)
585585

Diff for: instrumentation/opentelemetry-instrumentation-grpc/tests/test_client_interceptor.py

+5-5
Original file line numberDiff line numberDiff line change
@@ -111,7 +111,7 @@ def test_unary_unary_future(self):
111111
self.assertIs(span.kind, trace.SpanKind.CLIENT)
112112

113113
# Check version and name in span's instrumentation info
114-
self.assertEqualSpanInstrumentationInfo(
114+
self.assertEqualSpanInstrumentationScope(
115115
span, opentelemetry.instrumentation.grpc
116116
)
117117

@@ -125,7 +125,7 @@ def test_unary_unary(self):
125125
self.assertIs(span.kind, trace.SpanKind.CLIENT)
126126

127127
# Check version and name in span's instrumentation info
128-
self.assertEqualSpanInstrumentationInfo(
128+
self.assertEqualSpanInstrumentationScope(
129129
span, opentelemetry.instrumentation.grpc
130130
)
131131

@@ -151,7 +151,7 @@ def test_unary_stream(self):
151151
self.assertIs(span.kind, trace.SpanKind.CLIENT)
152152

153153
# Check version and name in span's instrumentation info
154-
self.assertEqualSpanInstrumentationInfo(
154+
self.assertEqualSpanInstrumentationScope(
155155
span, opentelemetry.instrumentation.grpc
156156
)
157157

@@ -177,7 +177,7 @@ def test_stream_unary(self):
177177
self.assertIs(span.kind, trace.SpanKind.CLIENT)
178178

179179
# Check version and name in span's instrumentation info
180-
self.assertEqualSpanInstrumentationInfo(
180+
self.assertEqualSpanInstrumentationScope(
181181
span, opentelemetry.instrumentation.grpc
182182
)
183183

@@ -205,7 +205,7 @@ def test_stream_stream(self):
205205
self.assertIs(span.kind, trace.SpanKind.CLIENT)
206206

207207
# Check version and name in span's instrumentation info
208-
self.assertEqualSpanInstrumentationInfo(
208+
self.assertEqualSpanInstrumentationScope(
209209
span, opentelemetry.instrumentation.grpc
210210
)
211211

Diff for: instrumentation/opentelemetry-instrumentation-grpc/tests/test_client_interceptor_filter.py

+9-9
Original file line numberDiff line numberDiff line change
@@ -116,7 +116,7 @@ def test_unary_unary_future(self):
116116
self.assertIs(span.kind, trace.SpanKind.CLIENT)
117117

118118
# Check version and name in span's instrumentation info
119-
self.assertEqualSpanInstrumentationInfo(
119+
self.assertEqualSpanInstrumentationScope(
120120
span, opentelemetry.instrumentation.grpc
121121
)
122122

@@ -130,7 +130,7 @@ def test_unary_unary(self):
130130
self.assertIs(span.kind, trace.SpanKind.CLIENT)
131131

132132
# Check version and name in span's instrumentation info
133-
self.assertEqualSpanInstrumentationInfo(
133+
self.assertEqualSpanInstrumentationScope(
134134
span, opentelemetry.instrumentation.grpc
135135
)
136136

@@ -260,7 +260,7 @@ def test_unary_unary_future(self):
260260
self.assertIs(span.kind, trace.SpanKind.CLIENT)
261261

262262
# Check version and name in span's instrumentation info
263-
self.assertEqualSpanInstrumentationInfo(
263+
self.assertEqualSpanInstrumentationScope(
264264
span, opentelemetry.instrumentation.grpc
265265
)
266266

@@ -274,7 +274,7 @@ def test_unary_unary(self):
274274
self.assertIs(span.kind, trace.SpanKind.CLIENT)
275275

276276
# Check version and name in span's instrumentation info
277-
self.assertEqualSpanInstrumentationInfo(
277+
self.assertEqualSpanInstrumentationScope(
278278
span, opentelemetry.instrumentation.grpc
279279
)
280280

@@ -443,7 +443,7 @@ def test_unary_unary_future(self):
443443
self.assertIs(span.kind, trace.SpanKind.CLIENT)
444444

445445
# Check version and name in span's instrumentation info
446-
self.assertEqualSpanInstrumentationInfo(
446+
self.assertEqualSpanInstrumentationScope(
447447
span, opentelemetry.instrumentation.grpc
448448
)
449449

@@ -457,7 +457,7 @@ def test_unary_unary(self):
457457
self.assertIs(span.kind, trace.SpanKind.CLIENT)
458458

459459
# Check version and name in span's instrumentation info
460-
self.assertEqualSpanInstrumentationInfo(
460+
self.assertEqualSpanInstrumentationScope(
461461
span, opentelemetry.instrumentation.grpc
462462
)
463463

@@ -483,7 +483,7 @@ def test_unary_stream(self):
483483
self.assertIs(span.kind, trace.SpanKind.CLIENT)
484484

485485
# Check version and name in span's instrumentation info
486-
self.assertEqualSpanInstrumentationInfo(
486+
self.assertEqualSpanInstrumentationScope(
487487
span, opentelemetry.instrumentation.grpc
488488
)
489489

@@ -509,7 +509,7 @@ def test_stream_unary(self):
509509
self.assertIs(span.kind, trace.SpanKind.CLIENT)
510510

511511
# Check version and name in span's instrumentation info
512-
self.assertEqualSpanInstrumentationInfo(
512+
self.assertEqualSpanInstrumentationScope(
513513
span, opentelemetry.instrumentation.grpc
514514
)
515515

@@ -537,7 +537,7 @@ def test_stream_stream(self):
537537
self.assertIs(span.kind, trace.SpanKind.CLIENT)
538538

539539
# Check version and name in span's instrumentation info
540-
self.assertEqualSpanInstrumentationInfo(
540+
self.assertEqualSpanInstrumentationScope(
541541
span, opentelemetry.instrumentation.grpc
542542
)
543543

Diff for: instrumentation/opentelemetry-instrumentation-grpc/tests/test_server_interceptor.py

+7-7
Original file line numberDiff line numberDiff line change
@@ -120,7 +120,7 @@ def handler(request, context):
120120
self.assertIs(span.kind, trace.SpanKind.SERVER)
121121

122122
# Check version and name in span's instrumentation info
123-
self.assertEqualSpanInstrumentationInfo(
123+
self.assertEqualSpanInstrumentationScope(
124124
span, opentelemetry.instrumentation.grpc
125125
)
126126

@@ -188,7 +188,7 @@ def test_create_span(self):
188188
self.assertIs(span.kind, trace.SpanKind.SERVER)
189189

190190
# Check version and name in span's instrumentation info
191-
self.assertEqualSpanInstrumentationInfo(
191+
self.assertEqualSpanInstrumentationScope(
192192
span, opentelemetry.instrumentation.grpc
193193
)
194194

@@ -252,7 +252,7 @@ def SimpleMethod(self, request, context):
252252
self.assertIs(parent_span.kind, trace.SpanKind.SERVER)
253253

254254
# Check version and name in span's instrumentation info
255-
self.assertEqualSpanInstrumentationInfo(
255+
self.assertEqualSpanInstrumentationScope(
256256
parent_span, opentelemetry.instrumentation.grpc
257257
)
258258

@@ -307,7 +307,7 @@ def test_create_span_streaming(self):
307307
self.assertIs(span.kind, trace.SpanKind.SERVER)
308308

309309
# Check version and name in span's instrumentation info
310-
self.assertEqualSpanInstrumentationInfo(
310+
self.assertEqualSpanInstrumentationScope(
311311
span, opentelemetry.instrumentation.grpc
312312
)
313313

@@ -371,7 +371,7 @@ def ServerStreamingMethod(self, request, context):
371371
self.assertIs(parent_span.kind, trace.SpanKind.SERVER)
372372

373373
# Check version and name in span's instrumentation info
374-
self.assertEqualSpanInstrumentationInfo(
374+
self.assertEqualSpanInstrumentationScope(
375375
parent_span, opentelemetry.instrumentation.grpc
376376
)
377377

@@ -594,7 +594,7 @@ def unset_status_handler(request, context):
594594
self.assertIs(span.kind, trace.SpanKind.SERVER)
595595

596596
# Check version and name in span's instrumentation info
597-
self.assertEqualSpanInstrumentationInfo(
597+
self.assertEqualSpanInstrumentationScope(
598598
span, opentelemetry.instrumentation.grpc
599599
)
600600

@@ -626,7 +626,7 @@ def unset_status_handler(request, context):
626626
self.assertIs(span.kind, trace.SpanKind.SERVER)
627627

628628
# Check version and name in span's instrumentation info
629-
self.assertEqualSpanInstrumentationInfo(
629+
self.assertEqualSpanInstrumentationScope(
630630
span, opentelemetry.instrumentation.grpc
631631
)
632632

Diff for: instrumentation/opentelemetry-instrumentation-grpc/tests/test_server_interceptor_filter.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -109,7 +109,7 @@ def handler(request, context):
109109
self.assertIs(span.kind, trace.SpanKind.SERVER)
110110

111111
# Check version and name in span's instrumentation info
112-
self.assertEqualSpanInstrumentationInfo(
112+
self.assertEqualSpanInstrumentationScope(
113113
span, opentelemetry.instrumentation.grpc
114114
)
115115

@@ -195,7 +195,7 @@ def test_create_span(self):
195195
self.assertIs(span.kind, trace.SpanKind.SERVER)
196196

197197
# Check version and name in span's instrumentation info
198-
self.assertEqualSpanInstrumentationInfo(
198+
self.assertEqualSpanInstrumentationScope(
199199
span, opentelemetry.instrumentation.grpc
200200
)
201201

0 commit comments

Comments
 (0)