Skip to content

Commit 32335dd

Browse files
authored
fix(profiling): profiler_id uses underscore (#3249)
Relay expects this with an underscore instead of a dot.
1 parent 763e40a commit 32335dd

File tree

3 files changed

+6
-6
lines changed

3 files changed

+6
-6
lines changed

sentry_sdk/consts.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -379,7 +379,7 @@ class SPANDATA:
379379
Example: "MainThread"
380380
"""
381381

382-
PROFILER_ID = "profiler.id"
382+
PROFILER_ID = "profiler_id"
383383
"""
384384
Label identifying the profiler id that the span occurred in. This should be a string.
385385
Example: "5249fbada8d5416482c2f6e47e337372"

sentry_sdk/tracing.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -115,7 +115,7 @@ class TransactionKwargs(SpanKwargs, total=False):
115115
ProfileContext = TypedDict(
116116
"ProfileContext",
117117
{
118-
"profiler.id": str,
118+
"profiler_id": str,
119119
},
120120
)
121121

@@ -693,7 +693,7 @@ def get_profile_context(self):
693693
return None
694694

695695
return {
696-
"profiler.id": profiler_id,
696+
"profiler_id": profiler_id,
697697
}
698698

699699

tests/profiler/test_continuous_profiler.py

+3-3
Original file line numberDiff line numberDiff line change
@@ -101,16 +101,16 @@ def assert_single_transaction_with_profile_chunks(envelopes, thread):
101101
)
102102

103103
profile_context = transaction["contexts"]["profile"]
104-
profiler_id = profile_context["profiler.id"]
104+
profiler_id = profile_context["profiler_id"]
105105

106-
assert profile_context == ApproxDict({"profiler.id": profiler_id})
106+
assert profile_context == ApproxDict({"profiler_id": profiler_id})
107107

108108
spans = transaction["spans"]
109109
assert len(spans) > 0
110110
for span in spans:
111111
assert span["data"] == ApproxDict(
112112
{
113-
"profiler.id": profiler_id,
113+
"profiler_id": profiler_id,
114114
"thread.id": str(thread.ident),
115115
"thread.name": thread.name,
116116
}

0 commit comments

Comments
 (0)