Skip to content

Commit db53f8b

Browse files
authored
fix(ourlogs): Hide internal attributes from the details (#91046)
Some attributes like 'project' can be sent as one of multiple aliases, and there are a few other internal attributes that we'd like to hide.
1 parent ab3bb06 commit db53f8b

File tree

3 files changed

+13
-7
lines changed

3 files changed

+13
-7
lines changed

static/app/views/explore/logs/constants.tsx

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,8 @@ const AlwaysHiddenLogFields: OurLogFieldKey[] = [
2929
OurLogKnownFieldKey.ID,
3030
OurLogKnownFieldKey.ORGANIZATION_ID,
3131
OurLogKnownFieldKey.ITEM_TYPE,
32-
OurLogKnownFieldKey.PROJECT,
32+
'project.id',
33+
'project_id', // these are both aliases that might show up
3334
];
3435

3536
/**
@@ -38,6 +39,12 @@ const AlwaysHiddenLogFields: OurLogFieldKey[] = [
3839
export const HiddenLogDetailFields: OurLogFieldKey[] = [
3940
...AlwaysHiddenLogFields,
4041
OurLogKnownFieldKey.MESSAGE,
42+
43+
// deprecated/otel fields that clutter the UI
44+
'sentry.timestamp_nanos',
45+
'tags[sentry.timestamp_precise,number]',
46+
'tags[sentry.trace_flags,number]',
47+
'span_id',
4148
];
4249

4350
export const HiddenColumnEditorLogFields: OurLogFieldKey[] = [...AlwaysHiddenLogFields];

static/app/views/explore/logs/logsTableRow.spec.tsx

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -152,13 +152,11 @@ describe('logsTableRow', () => {
152152
expect(hasNoWrapRecursive(logTableRow)).toBe(false);
153153

154154
// Check that the attribute values are rendered
155-
expect(screen.getByText(projects[0]!.id)).toBeInTheDocument();
155+
expect(screen.queryByText(projects[0]!.id)).not.toBeInTheDocument();
156156
expect(screen.getByText('456')).toBeInTheDocument();
157157
expect(screen.getByText('7b91699f')).toBeInTheDocument();
158158

159159
// Check that the attributes keys are rendered
160-
expect(screen.getByTestId('tree-key-project.id')).toBeInTheDocument();
161-
expect(screen.getByTestId('tree-key-project.id')).toHaveTextContent('id');
162160
expect(screen.getByTestId('tree-key-severity_number')).toBeInTheDocument();
163161
expect(screen.getByTestId('tree-key-severity_number')).toHaveTextContent(
164162
'severity_number'

tests/acceptance/test_explore_logs.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -81,6 +81,7 @@ def test_opening_log_row_shows_attributes(self, mock_now):
8181
assert "1234567890" in columns[0].text
8282
assert "long_attribute" in columns[0].text
8383
assert "a" * 1000 in columns[0].text
84-
assert "nested value1" in columns[1].text
85-
assert "nested value2" in columns[1].text
86-
assert "nested value3" in columns[1].text
84+
assert "nested value1" in columns[0].text
85+
assert "nested value2" in columns[0].text
86+
assert "nested value3" in columns[0].text
87+
assert "value1" in columns[1].text

0 commit comments

Comments
 (0)