|
@@ -1,11 +1,20 @@
|
|
|
import styled from '@emotion/styled';
|
|
|
|
|
|
+import {LinkButton} from 'sentry/components/button';
|
|
|
import {EventDataSection} from 'sentry/components/events/eventDataSection';
|
|
|
import {getProblemSpansForSpanTree} from 'sentry/components/events/interfaces/performance/utils';
|
|
|
+import {IconSettings} from 'sentry/icons';
|
|
|
import {t} from 'sentry/locale';
|
|
|
-import {EventTransaction, Organization} from 'sentry/types';
|
|
|
+import {space} from 'sentry/styles/space';
|
|
|
+import {
|
|
|
+ EventTransaction,
|
|
|
+ getIssueTypeFromOccurenceType,
|
|
|
+ IssueType,
|
|
|
+ Organization,
|
|
|
+} from 'sentry/types';
|
|
|
import {ProfileGroupProvider} from 'sentry/views/profiling/profileGroupProvider';
|
|
|
import {ProfileContext, ProfilesProvider} from 'sentry/views/profiling/profilesProvider';
|
|
|
+import {projectDetectorSettingsId} from 'sentry/views/settings/projectPerformance/projectPerformance';
|
|
|
|
|
|
import TraceView from '../spans/traceView';
|
|
|
import {TraceContextType} from '../spans/types';
|
|
@@ -34,6 +43,14 @@ export function SpanEvidenceSection({event, organization, projectSlug}: Props) {
|
|
|
|
|
|
const hasProfilingFeature = organization.features.includes('profiling');
|
|
|
|
|
|
+ const issueType = getIssueTypeFromOccurenceType(event.occurrence?.type);
|
|
|
+ const hasConfigurableThresholds =
|
|
|
+ issueType &&
|
|
|
+ ![
|
|
|
+ IssueType.PERFORMANCE_N_PLUS_ONE_API_CALLS, // TODO Abdullah Khan: Remove check when thresholds for these two issues are configurable.
|
|
|
+ IssueType.PERFORMANCE_CONSECUTIVE_HTTP,
|
|
|
+ ].includes(issueType);
|
|
|
+
|
|
|
return (
|
|
|
<EventDataSection
|
|
|
title={t('Span Evidence')}
|
|
@@ -41,6 +58,18 @@ export function SpanEvidenceSection({event, organization, projectSlug}: Props) {
|
|
|
help={t(
|
|
|
'Span Evidence identifies the root cause of this issue, found in other similar events within the same issue.'
|
|
|
)}
|
|
|
+ actions={
|
|
|
+ hasConfigurableThresholds && (
|
|
|
+ <LinkButton
|
|
|
+ data-test-id="span-evidence-settings-btn"
|
|
|
+ to={`/settings/projects/${projectSlug}/performance/#${projectDetectorSettingsId}`}
|
|
|
+ size="xs"
|
|
|
+ >
|
|
|
+ <StyledSettingsIcon size="xs" />
|
|
|
+ Settings
|
|
|
+ </LinkButton>
|
|
|
+ )
|
|
|
+ }
|
|
|
>
|
|
|
<SpanEvidenceKeyValueList event={event} projectSlug={projectSlug} />
|
|
|
{hasProfilingFeature ? (
|
|
@@ -96,3 +125,7 @@ const TraceViewWrapper = styled('div')`
|
|
|
border: 1px solid ${p => p.theme.innerBorder};
|
|
|
border-radius: ${p => p.theme.borderRadius};
|
|
|
`;
|
|
|
+
|
|
|
+const StyledSettingsIcon = styled(IconSettings)`
|
|
|
+ margin-right: ${space(0.5)};
|
|
|
+`;
|