feat(awooop): expose source refs on incidents
This commit is contained in:
@@ -88,6 +88,31 @@ export interface AwoooPStatusChain {
|
||||
}>;
|
||||
};
|
||||
};
|
||||
source_refs?: {
|
||||
inbound_total?: number | null;
|
||||
outbound_total?: number | null;
|
||||
inbound_channels?: string[];
|
||||
refs?: {
|
||||
alert_ids?: string[];
|
||||
sentry_issue_ids?: string[];
|
||||
signoz_alerts?: string[];
|
||||
fingerprints?: string[];
|
||||
incident_ids?: string[];
|
||||
};
|
||||
latest_inbound?: {
|
||||
channel_type?: string | null;
|
||||
provider_event_id?: string | null;
|
||||
content_type?: string | null;
|
||||
is_duplicate?: boolean | null;
|
||||
received_at?: string | null;
|
||||
};
|
||||
latest_outbound?: {
|
||||
channel_type?: string | null;
|
||||
message_type?: string | null;
|
||||
send_status?: string | null;
|
||||
sent_at?: string | null;
|
||||
};
|
||||
};
|
||||
}
|
||||
|
||||
function toneClass(chain?: AwoooPStatusChain | null) {
|
||||
|
||||
@@ -380,6 +380,22 @@ export function IncidentCard({ incident, decision, statusChain, onApprovalChange
|
||||
playbook: executionPlaybook,
|
||||
})
|
||||
: null
|
||||
const sourceRefs = statusChain?.source_refs
|
||||
const latestSource = sourceRefs?.latest_inbound?.channel_type
|
||||
? `${sourceRefs.latest_inbound.channel_type}/${chainValue(sourceRefs.latest_inbound.provider_event_id)}`
|
||||
: sourceRefs?.latest_outbound?.channel_type
|
||||
? `${sourceRefs.latest_outbound.channel_type}/${chainValue(sourceRefs.latest_outbound.message_type)}`
|
||||
: '--'
|
||||
const statusChainSourceRefDetail = hasTruthChain
|
||||
? t('flowSourceRefsDetail', {
|
||||
inbound: sourceRefs?.inbound_total ?? 0,
|
||||
outbound: sourceRefs?.outbound_total ?? 0,
|
||||
alert: sourceRefs?.refs?.alert_ids?.length ?? 0,
|
||||
sentry: sourceRefs?.refs?.sentry_issue_ids?.length ?? 0,
|
||||
signoz: sourceRefs?.refs?.signoz_alerts?.length ?? 0,
|
||||
latest: latestSource,
|
||||
})
|
||||
: null
|
||||
|
||||
const serviceName = incident.affected_services?.[0] ?? '--'
|
||||
const duration = formatDuration(incident.created_at)
|
||||
@@ -659,6 +675,10 @@ export function IncidentCard({ incident, decision, statusChain, onApprovalChange
|
||||
<span data-testid="incident-execution-evidence" style={{ color: '#555550' }}>
|
||||
{statusChainExecutionDetail}
|
||||
</span>
|
||||
<span style={{ color: '#b0ad9f' }}>/</span>
|
||||
<span data-testid="incident-source-ref-evidence" style={{ color: '#555550' }}>
|
||||
{statusChainSourceRefDetail}
|
||||
</span>
|
||||
</>
|
||||
)}
|
||||
</div>
|
||||
|
||||
Reference in New Issue
Block a user