Skip to content

Commit 145df55

Browse files
authored
feat(perf): Hide timing metrics on http (#52993)
### Summary Timing metrics for http are coming out but there are a lot and there is already a lot of keys on the span details, this will hide the timing metrics for now. We can opt-in specific ones on a case-by-case later.
1 parent 4eceac5 commit 145df55

File tree

1 file changed

+25
-6
lines changed

1 file changed

+25
-6
lines changed

static/app/components/events/interfaces/spans/spanDetail.tsx

+25-6
Original file line numberDiff line numberDiff line change
@@ -69,6 +69,19 @@ const SIZE_DATA_KEYS = [
6969
'http.response_transfer_size',
7070
];
7171

72+
const HIDDEN_DATA_KEYS = [
73+
'http.request.redirect_start',
74+
'http.request.fetch_start',
75+
'http.request.domain_lookup_start',
76+
'http.request.domain_lookup_end',
77+
'http.request.connect_start',
78+
'http.request.secure_connection_start',
79+
'http.request.connection_end',
80+
'http.request.request_start',
81+
'http.request.response_start',
82+
'http.request.response_end',
83+
];
84+
7285
type TransactionResult = {
7386
id: string;
7487
'project.name': string;
@@ -88,6 +101,10 @@ type Props = {
88101
trace: Readonly<ParsedTraceType>;
89102
};
90103

104+
function isSpanKeyVisible(key: string) {
105+
return !HIDDEN_DATA_KEYS.includes(key);
106+
}
107+
91108
function SpanDetail(props: Props) {
92109
const [errorsOpened, setErrorsOpened] = useState(false);
93110
const location = useLocation();
@@ -390,7 +407,7 @@ function SpanDetail(props: Props) {
390407
const durationString = `${Number(duration.toFixed(3)).toLocaleString()}ms`;
391408

392409
const unknownKeys = Object.keys(span).filter(key => {
393-
return !rawSpanKeys.has(key as any);
410+
return isSpanKeyVisible(key) && !rawSpanKeys.has(key as any);
394411
});
395412

396413
const {sizeKeys, nonSizeKeys} = partitionSizes(span?.data ?? {});
@@ -522,11 +539,13 @@ function SpanDetail(props: Props) {
522539
</Fragment>
523540
</Row>
524541
))}
525-
{map(nonSizeKeys, (value, key) => (
526-
<Row title={key} key={key}>
527-
{maybeStringify(value)}
528-
</Row>
529-
))}
542+
{map(nonSizeKeys, (value, key) =>
543+
isSpanKeyVisible(key) ? (
544+
<Row title={key} key={key}>
545+
{maybeStringify(value)}
546+
</Row>
547+
) : null
548+
)}
530549
{unknownKeys.map(key => (
531550
<Row title={key} key={key}>
532551
{maybeStringify(span[key])}

0 commit comments

Comments
 (0)