Skip to content

Commit

Permalink
fix(profiling): profiler_id uses underscore (#3249)
Browse files Browse the repository at this point in the history
Relay expects this with an underscore instead of a dot.
  • Loading branch information
Zylphrex committed Jul 8, 2024
1 parent 763e40a commit 32335dd
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 6 deletions.
2 changes: 1 addition & 1 deletion sentry_sdk/consts.py
Original file line number Diff line number Diff line change
Expand Up @@ -379,7 +379,7 @@ class SPANDATA:
Example: "MainThread"
"""

PROFILER_ID = "profiler.id"
PROFILER_ID = "profiler_id"
"""
Label identifying the profiler id that the span occurred in. This should be a string.
Example: "5249fbada8d5416482c2f6e47e337372"
Expand Down
4 changes: 2 additions & 2 deletions sentry_sdk/tracing.py
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,7 @@ class TransactionKwargs(SpanKwargs, total=False):
ProfileContext = TypedDict(
"ProfileContext",
{
"profiler.id": str,
"profiler_id": str,
},
)

Expand Down Expand Up @@ -693,7 +693,7 @@ def get_profile_context(self):
return None

return {
"profiler.id": profiler_id,
"profiler_id": profiler_id,
}


Expand Down
6 changes: 3 additions & 3 deletions tests/profiler/test_continuous_profiler.py
Original file line number Diff line number Diff line change
Expand Up @@ -101,16 +101,16 @@ def assert_single_transaction_with_profile_chunks(envelopes, thread):
)

profile_context = transaction["contexts"]["profile"]
profiler_id = profile_context["profiler.id"]
profiler_id = profile_context["profiler_id"]

assert profile_context == ApproxDict({"profiler.id": profiler_id})
assert profile_context == ApproxDict({"profiler_id": profiler_id})

spans = transaction["spans"]
assert len(spans) > 0
for span in spans:
assert span["data"] == ApproxDict(
{
"profiler.id": profiler_id,
"profiler_id": profiler_id,
"thread.id": str(thread.ident),
"thread.name": thread.name,
}
Expand Down

0 comments on commit 32335dd

Please sign in to comment.