Skip to content
Open
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
17 changes: 15 additions & 2 deletions static/app/views/alerts/rules/uptime/uptimeChecksGrid.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ import {space} from 'sentry/styles/space';
import {getShortEventId} from 'sentry/utils/events';
import {MutableSearch} from 'sentry/utils/tokenizeSearch';
import type {UptimeCheck} from 'sentry/views/alerts/rules/uptime/types';
import {CheckStatus} from 'sentry/views/alerts/rules/uptime/types';
import {useSpans} from 'sentry/views/insights/common/queries/useDiscover';
import {
reasonToText,
Expand All @@ -32,6 +33,8 @@ type Props = {
*/
const EMPTY_TRACE = '00000000000000000000000000000000';

const emptyCell = '\u2014';

/**
* The number of system uptime spans that are always recorded for each uptime check.
*/
Expand Down Expand Up @@ -117,6 +120,8 @@ function CheckInBodyCell({
return <Cell />;
}

const isMiss = checkStatus === CheckStatus.MISSED_WINDOW;

switch (column.key) {
case 'timestamp': {
return (
Expand All @@ -132,12 +137,18 @@ function CheckInBodyCell({
);
}
case 'durationMs':
if (isMiss) {
return <Cell>{emptyCell}</Cell>;
}
return (
<Cell>
<Duration seconds={durationMs / 1000} abbreviation exact />
</Cell>
);
case 'httpStatusCode': {
if (isMiss) {
return <Cell>{emptyCell}</Cell>;
}
if (httpStatusCode === null) {
return <Cell style={{color: theme.subText}}>{t('None')}</Cell>;
}
Expand All @@ -156,8 +167,8 @@ function CheckInBodyCell({
);
}
case 'traceId': {
if (traceId === EMPTY_TRACE) {
return <Cell />;
if (isMiss || traceId === EMPTY_TRACE) {
return <Cell>{emptyCell}</Cell>;
}

const learnMore = (
Expand Down Expand Up @@ -210,6 +221,8 @@ function CheckInBodyCell({
</TraceCell>
);
}
case 'regionName':
return <Cell>{isMiss ? emptyCell : check.regionName}</Cell>;
default:
return <Cell>{check[column.key]}</Cell>;
}
Expand Down
Loading