Skip to content

Commit 3265644

Browse files
ref(spans): Rename __sentry_internal to sentry._internal attributes (#97560)
See getsentry/sentry-conventions#98 --------- Co-authored-by: getsantry[bot] <66042841+getsantry[bot]@users.noreply.github.com>
1 parent fa36f54 commit 3265644

File tree

4 files changed

+11
-6
lines changed

4 files changed

+11
-6
lines changed

src/sentry/spans/buffer.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -432,10 +432,10 @@ def flush_segments(self, now: int) -> dict[SegmentKey, FlushedSegment]:
432432

433433
val_data = val.setdefault("data", {})
434434
if isinstance(val_data, dict):
435-
val_data["__sentry_internal_span_buffer_outcome"] = outcome
435+
val_data["sentry._internal.span_buffer_segment_id_outcome"] = outcome
436436

437437
if old_segment_id:
438-
val_data["__sentry_internal_old_segment_id"] = old_segment_id
438+
val_data["sentry._internal.span_buffer_old_segment_id"] = old_segment_id
439439

440440
val["segment_id"] = segment_span_id
441441

static/app/views/performance/newTraceDetails/traceDrawer/details/span/eapSections/attributes.tsx

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -110,9 +110,14 @@ export function Attributes({
110110
attribute => !HIDDEN_ATTRIBUTES.includes(attribute.name)
111111
);
112112

113-
// `__sentry_internal` attributes are used to track internal system behavior (e.g., the span buffer outcomes). Only show these to Sentry staff.
113+
// `sentry._internal` attributes are used to track internal system behavior (e.g., the span buffer outcomes). Only show these to Sentry staff.
114114
const onlyAllowedAttributes = onlyVisibleAttributes.filter(attribute => {
115-
if (attribute.name.startsWith('__sentry_internal') && !isSentryEmployee) {
115+
if (
116+
(attribute.name.startsWith('sentry._internal') ||
117+
attribute.name.startsWith('sentry._meta') ||
118+
attribute.name.startsWith('__sentry_internal')) &&
119+
!isSentryEmployee
120+
) {
116121
return false;
117122
}
118123

tests/sentry/spans/consumers/process/test_consumer.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,7 @@ def add_commit(offsets, force=False):
7777
"spans": [
7878
{
7979
"data": {
80-
"__sentry_internal_span_buffer_outcome": "different",
80+
"sentry._internal.span_buffer_segment_id_outcome": "different",
8181
},
8282
"is_segment": True,
8383
"project_id": 12,

tests/sentry/spans/test_buffer.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ def _output_segment(span_id: bytes, segment_id: bytes, is_segment: bool) -> Outp
4646
return OutputSpan(
4747
payload={
4848
"data": {
49-
"__sentry_internal_span_buffer_outcome": "different",
49+
"sentry._internal.span_buffer_segment_id_outcome": "different",
5050
},
5151
"span_id": span_id.decode("ascii"),
5252
"segment_id": segment_id.decode("ascii"),

0 commit comments

Comments
 (0)