Skip to content

Commit d719576

Browse files
committed
Updated span name setting
1 parent bc23f65 commit d719576

File tree

1 file changed

+10
-2
lines changed

1 file changed

+10
-2
lines changed

tests/tracing/test_misc.py

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -202,11 +202,11 @@ def test_span_set_data_update_data(sentry_init, capture_events):
202202
events = capture_events()
203203

204204
with sentry_sdk.start_span(name="test-root-span"):
205-
with start_span(op="test-span") as span:
205+
with start_span(op="test-span", name="test-span-name") as span:
206206
span.set_data("key0", "value0")
207207
span.set_data("key1", "value1")
208208

209-
span.update_data(
209+
span.set_attributes(
210210
{
211211
"key1": "updated-value1",
212212
"key2": "value2",
@@ -222,6 +222,10 @@ def test_span_set_data_update_data(sentry_init, capture_events):
222222
"key1": "updated-value1",
223223
"key2": "value2",
224224
"key3": "value3",
225+
"sentry.name": "test-span-name",
226+
"sentry.op": "test-span",
227+
"sentry.origin": "manual",
228+
"sentry.source": "custom",
225229
"thread.id": ANY,
226230
"thread.name": ANY,
227231
}
@@ -267,6 +271,10 @@ def test_update_current_span(sentry_init, capture_events):
267271
"key0": "value0",
268272
"key1": "updated-value-4",
269273
"key2": "value2",
274+
"sentry.name": "updated-span-name-3",
275+
"sentry.op": "updated-span-op-2",
276+
"sentry.origin": "manual",
277+
"sentry.source": "custom",
270278
"thread.id": ANY,
271279
"thread.name": ANY,
272280
}

0 commit comments

Comments
 (0)