@@ -47,9 +47,7 @@ def _check_span(self, span, name):
47
47
48
48
def test_long_command_sanitized (self ):
49
49
RedisInstrumentor ().uninstrument ()
50
- RedisInstrumentor ().instrument (
51
- tracer_provider = self .tracer_provider , sanitize_query = True
52
- )
50
+ RedisInstrumentor ().instrument (tracer_provider = self .tracer_provider )
53
51
54
52
self .redis_client .mget (* range (2000 ))
55
53
@@ -75,7 +73,7 @@ def test_long_command(self):
75
73
self ._check_span (span , "MGET" )
76
74
self .assertTrue (
77
75
span .attributes .get (SpanAttributes .DB_STATEMENT ).startswith (
78
- "MGET 0 1 2 3 "
76
+ "MGET ? ? ? ? "
79
77
)
80
78
)
81
79
self .assertTrue (
@@ -84,9 +82,7 @@ def test_long_command(self):
84
82
85
83
def test_basics_sanitized (self ):
86
84
RedisInstrumentor ().uninstrument ()
87
- RedisInstrumentor ().instrument (
88
- tracer_provider = self .tracer_provider , sanitize_query = True
89
- )
85
+ RedisInstrumentor ().instrument (tracer_provider = self .tracer_provider )
90
86
91
87
self .assertIsNone (self .redis_client .get ("cheese" ))
92
88
spans = self .memory_exporter .get_finished_spans ()
@@ -105,15 +101,13 @@ def test_basics(self):
105
101
span = spans [0 ]
106
102
self ._check_span (span , "GET" )
107
103
self .assertEqual (
108
- span .attributes .get (SpanAttributes .DB_STATEMENT ), "GET cheese "
104
+ span .attributes .get (SpanAttributes .DB_STATEMENT ), "GET ? "
109
105
)
110
106
self .assertEqual (span .attributes .get ("db.redis.args_length" ), 2 )
111
107
112
108
def test_pipeline_traced_sanitized (self ):
113
109
RedisInstrumentor ().uninstrument ()
114
- RedisInstrumentor ().instrument (
115
- tracer_provider = self .tracer_provider , sanitize_query = True
116
- )
110
+ RedisInstrumentor ().instrument (tracer_provider = self .tracer_provider )
117
111
118
112
with self .redis_client .pipeline (transaction = False ) as pipeline :
119
113
pipeline .set ("blah" , 32 )
@@ -144,15 +138,13 @@ def test_pipeline_traced(self):
144
138
self ._check_span (span , "SET RPUSH HGETALL" )
145
139
self .assertEqual (
146
140
span .attributes .get (SpanAttributes .DB_STATEMENT ),
147
- "SET blah 32 \n RPUSH foo éé \n HGETALL xxx " ,
141
+ "SET ? ? \n RPUSH ? ? \n HGETALL ? " ,
148
142
)
149
143
self .assertEqual (span .attributes .get ("db.redis.pipeline_length" ), 3 )
150
144
151
145
def test_pipeline_immediate_sanitized (self ):
152
146
RedisInstrumentor ().uninstrument ()
153
- RedisInstrumentor ().instrument (
154
- tracer_provider = self .tracer_provider , sanitize_query = True
155
- )
147
+ RedisInstrumentor ().instrument (tracer_provider = self .tracer_provider )
156
148
157
149
with self .redis_client .pipeline () as pipeline :
158
150
pipeline .set ("a" , 1 )
@@ -182,7 +174,7 @@ def test_pipeline_immediate(self):
182
174
span = spans [0 ]
183
175
self ._check_span (span , "SET" )
184
176
self .assertEqual (
185
- span .attributes .get (SpanAttributes .DB_STATEMENT ), "SET b 2 "
177
+ span .attributes .get (SpanAttributes .DB_STATEMENT ), "SET ? ? "
186
178
)
187
179
188
180
def test_parent (self ):
@@ -230,7 +222,7 @@ def test_basics(self):
230
222
span = spans [0 ]
231
223
self ._check_span (span , "GET" )
232
224
self .assertEqual (
233
- span .attributes .get (SpanAttributes .DB_STATEMENT ), "GET cheese "
225
+ span .attributes .get (SpanAttributes .DB_STATEMENT ), "GET ? "
234
226
)
235
227
self .assertEqual (span .attributes .get ("db.redis.args_length" ), 2 )
236
228
@@ -247,7 +239,7 @@ def test_pipeline_traced(self):
247
239
self ._check_span (span , "SET RPUSH HGETALL" )
248
240
self .assertEqual (
249
241
span .attributes .get (SpanAttributes .DB_STATEMENT ),
250
- "SET blah 32 \n RPUSH foo éé \n HGETALL xxx " ,
242
+ "SET ? ? \n RPUSH ? ? \n HGETALL ? " ,
251
243
)
252
244
self .assertEqual (span .attributes .get ("db.redis.pipeline_length" ), 3 )
253
245
@@ -308,7 +300,7 @@ def test_long_command(self):
308
300
self ._check_span (span , "MGET" )
309
301
self .assertTrue (
310
302
span .attributes .get (SpanAttributes .DB_STATEMENT ).startswith (
311
- "MGET 0 1 2 3 "
303
+ "MGET ? ? ? ? "
312
304
)
313
305
)
314
306
self .assertTrue (
@@ -322,7 +314,7 @@ def test_basics(self):
322
314
span = spans [0 ]
323
315
self ._check_span (span , "GET" )
324
316
self .assertEqual (
325
- span .attributes .get (SpanAttributes .DB_STATEMENT ), "GET cheese "
317
+ span .attributes .get (SpanAttributes .DB_STATEMENT ), "GET ? "
326
318
)
327
319
self .assertEqual (span .attributes .get ("db.redis.args_length" ), 2 )
328
320
@@ -344,7 +336,7 @@ async def pipeline_simple():
344
336
self ._check_span (span , "SET RPUSH HGETALL" )
345
337
self .assertEqual (
346
338
span .attributes .get (SpanAttributes .DB_STATEMENT ),
347
- "SET blah 32 \n RPUSH foo éé \n HGETALL xxx " ,
339
+ "SET ? ? \n RPUSH ? ? \n HGETALL ? " ,
348
340
)
349
341
self .assertEqual (span .attributes .get ("db.redis.pipeline_length" ), 3 )
350
342
@@ -364,7 +356,7 @@ async def pipeline_immediate():
364
356
span = spans [0 ]
365
357
self ._check_span (span , "SET" )
366
358
self .assertEqual (
367
- span .attributes .get (SpanAttributes .DB_STATEMENT ), "SET b 2 "
359
+ span .attributes .get (SpanAttributes .DB_STATEMENT ), "SET ? ? "
368
360
)
369
361
370
362
def test_parent (self ):
@@ -412,7 +404,7 @@ def test_basics(self):
412
404
span = spans [0 ]
413
405
self ._check_span (span , "GET" )
414
406
self .assertEqual (
415
- span .attributes .get (SpanAttributes .DB_STATEMENT ), "GET cheese "
407
+ span .attributes .get (SpanAttributes .DB_STATEMENT ), "GET ? "
416
408
)
417
409
self .assertEqual (span .attributes .get ("db.redis.args_length" ), 2 )
418
410
@@ -434,7 +426,7 @@ async def pipeline_simple():
434
426
self ._check_span (span , "SET RPUSH HGETALL" )
435
427
self .assertEqual (
436
428
span .attributes .get (SpanAttributes .DB_STATEMENT ),
437
- "SET blah 32 \n RPUSH foo éé \n HGETALL xxx " ,
429
+ "SET ? ? \n RPUSH ? ? \n HGETALL ? " ,
438
430
)
439
431
self .assertEqual (span .attributes .get ("db.redis.pipeline_length" ), 3 )
440
432
@@ -488,5 +480,5 @@ def test_get(self):
488
480
span = spans [0 ]
489
481
self ._check_span (span , "GET" )
490
482
self .assertEqual (
491
- span .attributes .get (SpanAttributes .DB_STATEMENT ), "GET foo "
483
+ span .attributes .get (SpanAttributes .DB_STATEMENT ), "GET ? "
492
484
)
0 commit comments