Skip to content

Commit 5df9ccc

Browse files
committed
.
1 parent fa5d0ba commit 5df9ccc

File tree

3 files changed

+3
-2
lines changed

3 files changed

+3
-2
lines changed

sentry_sdk/integrations/opentelemetry/consts.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,3 +30,4 @@ class SentrySpanAttribute:
3030
NAME = "sentry.name"
3131
SOURCE = "sentry.source"
3232
CONTEXT = "sentry.context"
33+
CUSTOM_SAMPLED = "sentry.custom_sampled"

sentry_sdk/integrations/opentelemetry/sampler.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -132,7 +132,7 @@ def should_sample(
132132
sampling_context = {
133133
"transaction_context": {
134134
"name": name,
135-
"op": attributes.get("op"),
135+
"op": attributes.get(SentrySpanAttribute.OP),
136136
},
137137
"parent_sampled": get_parent_sampled(parent_span_context, trace_id),
138138
}

sentry_sdk/tracing.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1235,7 +1235,6 @@ def __init__(
12351235

12361236
# Prepopulate some attrs to be accessible in traces_sampler
12371237
attributes = attributes or {}
1238-
attributes[SentrySpanAttribute.NAME] = span_name
12391238
attributes[SentrySpanAttribute.OP] = op
12401239
if sampled is not None:
12411240
attributes[SentrySpanAttribute.CUSTOM_SAMPLED] = sampled
@@ -1244,6 +1243,7 @@ def __init__(
12441243
span_name, start_time=start_timestamp, attributes=attributes
12451244
)
12461245

1246+
self.name = name
12471247
self.origin = origin or DEFAULT_SPAN_ORIGIN
12481248
self.description = description
12491249
self.source = source

0 commit comments

Comments
 (0)