Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(profiling): profiler_id uses underscore #3249

Merged
merged 2 commits into from
Jul 8, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading