|
1 | 1 | import { API_URL, authenticatedFetch } from "@/lib/api"; |
| 2 | +import { isTracerSendSpan } from "@/lib/utils"; |
2 | 3 | import useSWR from "swr"; |
3 | 4 |
|
4 | 5 | export const getGroupingKey = (transaction: any, extended = false) => { |
@@ -46,16 +47,19 @@ export const getTransactionService = (transaction: any) => { |
46 | 47 | ) { |
47 | 48 | return "eventBridge"; |
48 | 49 | } |
49 | | - if (transaction.info?.httpInfo?.host === "hooks.slack.com" || transaction.info?.httpInfo?.host === "slack.com") { |
| 50 | + if ( |
| 51 | + transaction.info?.httpInfo?.host === "hooks.slack.com" || |
| 52 | + transaction.info?.httpInfo?.host === "slack.com" |
| 53 | + ) { |
50 | 54 | return "slack"; |
51 | 55 | } |
52 | | - if (transaction.info?.httpInfo?.host?.endsWith('.chargebee.com')) { |
| 56 | + if (transaction.info?.httpInfo?.host?.endsWith(".chargebee.com")) { |
53 | 57 | return "chargebee"; |
54 | 58 | } |
55 | | - if (transaction.info?.httpInfo?.host?.endsWith('.myshopify.com')) { |
| 59 | + if (transaction.info?.httpInfo?.host?.endsWith(".myshopify.com")) { |
56 | 60 | return "shopify"; |
57 | 61 | } |
58 | | - if (transaction.info?.httpInfo?.host === 'api.todoist.com') { |
| 62 | + if (transaction.info?.httpInfo?.host === "api.todoist.com") { |
59 | 63 | return "todoist"; |
60 | 64 | } |
61 | 65 |
|
@@ -87,16 +91,19 @@ export const getTransactionLabel = (transaction: any) => { |
87 | 91 | return "CloudFront"; |
88 | 92 | } |
89 | 93 |
|
90 | | - if (transaction.info?.httpInfo?.host === "hooks.slack.com" || transaction.info?.httpInfo?.host === "slack.com") { |
| 94 | + if ( |
| 95 | + transaction.info?.httpInfo?.host === "hooks.slack.com" || |
| 96 | + transaction.info?.httpInfo?.host === "slack.com" |
| 97 | + ) { |
91 | 98 | return "Slack"; |
92 | 99 | } |
93 | | - if (transaction.info?.httpInfo?.host?.endsWith('.chargebee.com')) { |
| 100 | + if (transaction.info?.httpInfo?.host?.endsWith(".chargebee.com")) { |
94 | 101 | return "Chargebee"; |
95 | 102 | } |
96 | | - if (transaction.info?.httpInfo?.host?.endsWith('.myshopify.com')) { |
| 103 | + if (transaction.info?.httpInfo?.host?.endsWith(".myshopify.com")) { |
97 | 104 | return "Shopify"; |
98 | 105 | } |
99 | | - if (transaction.info?.httpInfo?.host === 'api.todoist.com') { |
| 106 | + if (transaction.info?.httpInfo?.host === "api.todoist.com") { |
100 | 107 | return "Todoist"; |
101 | 108 | } |
102 | 109 |
|
@@ -127,7 +134,11 @@ export const getTransactionLabel = (transaction: any) => { |
127 | 134 | export const groupSpans = (spans?: any[]) => { |
128 | 135 | const grouped: { groupingKey: any; spans: any[] }[] = []; |
129 | 136 | for (const span of spans || []) { |
130 | | - if (span.id?.endsWith("_started") || span.spanType === "enrichment") |
| 137 | + if ( |
| 138 | + span.id?.endsWith("_started") || |
| 139 | + span.spanType === "enrichment" || |
| 140 | + isTracerSendSpan(span) |
| 141 | + ) |
131 | 142 | continue; |
132 | 143 |
|
133 | 144 | span.groupingKey = getGroupingKey(span, true); |
|
0 commit comments