Skip to content

Commit 2358fc7

Browse files
authored
ref(insights): standardize insight referrers (#97575)
Our referrers are all over the place in insights, this PR tries to standardize them a little bit 1. Updates all `api.starfish` referrers to be `api.insights` 2. Updates all `api.performance` referrers to be `api.insights` 3. Updates module referrers to be `api.insights.<module>` 4. Moves some referrers to their own `referrer.ts` file A follow up Pr will be made to update the backend referrer file
1 parent 4ad3fbe commit 2358fc7

File tree

97 files changed

+268
-245
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

97 files changed

+268
-245
lines changed

static/app/components/events/eventStatisticalDetector/aggregateSpanDiff.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -136,7 +136,7 @@ function AggregateSpanDiff({event, project}: AggregateSpanDiffProps) {
136136
limit: 10,
137137
enabled: isSpansOnly,
138138
},
139-
'api.performance.transactions.statistical-detector-root-cause-analysis'
139+
'api.insights.transactions.statistical-detector-root-cause-analysis'
140140
);
141141

142142
const tableData = useMemo(() => {

static/app/components/performance/searchBar.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -168,7 +168,7 @@ function SearchBar(props: SearchBarProps) {
168168
sort: '-count()',
169169
query: conditions.formatString(),
170170
statsPeriod,
171-
referrer: 'api.performance.transaction-name-search-bar',
171+
referrer: 'api.insights.transaction-name-search-bar',
172172
});
173173

174174
const parsedResults = results.data.reduce(
Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,15 @@
11
export enum Referrer {
2-
MODELS_TABLE = 'api.performance.agent-monitoring.models-table',
3-
TOOLS_TABLE = 'api.performance.agent-monitoring.tools-table',
4-
TRACE_DRAWER = 'api.performance.agent-monitoring.trace-drawer',
5-
TRACES_TABLE = 'api.performance.agent-monitoring.traces-table',
6-
TOKEN_USAGE_WIDGET = 'api.performance.agent-monitoring.token-usage-widget',
7-
MODEL_COST_WIDGET = 'api.performance.agent-monitoring.token-cost-widget',
8-
TOKEN_TYPES_WIDGET = 'api.performance.agent-monitoring.token-types-widget',
9-
TOOL_CALLS_WIDGET = 'api.performance.agent-monitoring.tool-calls-widget',
10-
TOOL_ERRORS_WIDGET = 'api.performance.agent-monitoring.tool-errors-widget',
11-
LLM_CALLS_WIDGET = 'api.performance.agent-monitoring.llm-calls-widget',
12-
AGENT_RUNS_WIDGET = 'api.performance.agent-monitoring.agent-runs-widget',
13-
AGENT_DURATION_WIDGET = 'api.performance.agent-monitoring.agent-duration-widget',
14-
ONBOARDING = 'api.performance.agent-monitoring.onboarding',
2+
MODELS_TABLE = 'api.insights.agent-monitoring.models-table',
3+
TOOLS_TABLE = 'api.insights.agent-monitoring.tools-table',
4+
TRACE_DRAWER = 'api.insights.agent-monitoring.trace-drawer',
5+
TRACES_TABLE = 'api.insights.agent-monitoring.traces-table',
6+
TOKEN_USAGE_WIDGET = 'api.insights.agent-monitoring.token-usage-widget',
7+
MODEL_COST_WIDGET = 'api.insights.agent-monitoring.token-cost-widget',
8+
TOKEN_TYPES_WIDGET = 'api.insights.agent-monitoring.token-types-widget',
9+
TOOL_CALLS_WIDGET = 'api.insights.agent-monitoring.tool-calls-widget',
10+
TOOL_ERRORS_WIDGET = 'api.insights.agent-monitoring.tool-errors-widget',
11+
LLM_CALLS_WIDGET = 'api.insights.agent-monitoring.llm-calls-widget',
12+
AGENT_RUNS_WIDGET = 'api.insights.agent-monitoring.agent-runs-widget',
13+
AGENT_DURATION_WIDGET = 'api.insights.agent-monitoring.agent-duration-widget',
14+
ONBOARDING = 'api.insights.agent-monitoring.onboarding',
1515
}

static/app/views/insights/browser/resources/components/sampleImages.spec.tsx

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -85,9 +85,7 @@ const setupMockRequests = (
8585
MockApiClient.addMockResponse({
8686
url: `/organizations/${organization.slug}/events/`,
8787
method: 'GET',
88-
match: [
89-
MockApiClient.matchQuery({referrer: 'api.performance.resources.sample-images'}),
90-
],
88+
match: [MockApiClient.matchQuery({referrer: 'api.insights.resources.sample-images'})],
9189
body: {
9290
data: [
9391
{

static/app/views/insights/browser/resources/components/sampleImages.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ function SampleImages({groupId, projectId}: Props) {
6161
...(filters[SPAN_OP] ? [`${SPAN_OP}:${filters[SPAN_OP]}`] : []),
6262
].join(' '),
6363
},
64-
'api.performance.resources.sample-images'
64+
'api.insights.resources.sample-images'
6565
);
6666

6767
const uniqueResources = new Set();

static/app/views/insights/browser/resources/components/tables/resourceTable.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -98,7 +98,7 @@ function ResourceTable({sort, defaultResourceTypes}: Props) {
9898
sort,
9999
defaultResourceTypes,
100100
cursor,
101-
referrer: 'api.performance.browser.resources.main-table',
101+
referrer: 'api.insights.browser.resources.main-table',
102102
});
103103

104104
const columnOrder: Column[] = [

static/app/views/insights/browser/resources/queries/useResourcePagesQuery.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ export const useResourcePagesQuery = (
3232
search: queryConditions.join(' '),
3333
limit: 100,
3434
},
35-
'api.performance.browser.resources.page-selector'
35+
'api.insights.browser.resources.page-selector'
3636
);
3737

3838
const pages = result?.data?.map(row => row.transaction).sort() || [];
Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
// TODO - all resource referrers here
22
export enum Referrer {
3-
RESOURCE_LANDING = 'api.performance.resource.resource-landing',
4-
RESOURCE_LANDING_SERIES = 'api.performance.resource.resource-landing-series',
5-
RESOURCE_SUMMARY_METRICS_RIBBON = 'api.performance.browser.resources.resource-summary-metrics-ribbon',
6-
RESOURCE_SUMMARY_AVERAGE_SIZE_CHART = 'api.performance.browser.resources.resource-summary-average-size-chart',
7-
RESOURCE_SUMMARY_DURATION_CHART = 'api.performance.browser.resources.resource-summary-duration-chart',
8-
RESOURCE_SUMMARY_THROUGHPUT_CHART = 'api.performance.browser.resources.resource-summary-throughput-chart',
3+
RESOURCE_LANDING = 'api.insights.resource.resource-landing',
4+
RESOURCE_LANDING_SERIES = 'api.insights.resource.resource-landing-series',
5+
RESOURCE_SUMMARY_METRICS_RIBBON = 'api.insights.browser.resources.resource-summary-metrics-ribbon',
6+
RESOURCE_SUMMARY_AVERAGE_SIZE_CHART = 'api.insights.browser.resources.resource-summary-average-size-chart',
7+
RESOURCE_SUMMARY_DURATION_CHART = 'api.insights.browser.resources.resource-summary-duration-chart',
8+
RESOURCE_SUMMARY_THROUGHPUT_CHART = 'api.insights.browser.resources.resource-summary-throughput-chart',
99
}

static/app/views/insights/browser/resources/views/resourcesLandingPage.spec.tsx

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@ describe('ResourcesLandingPage', function () {
7878
"per_page": 100,
7979
"project": [],
8080
"query": "has:sentry.normalized_description span.category:resource !sentry.normalized_description:"browser-extension://*" span.op:[resource.script,resource.css,resource.font,resource.img]",
81-
"referrer": "api.starfish.get-span-domains",
81+
"referrer": "api.insights.get-span-domains",
8282
"sampling": "NORMAL",
8383
"sort": "-count()",
8484
"statsPeriod": "10d",
@@ -119,7 +119,7 @@ describe('ResourcesLandingPage', function () {
119119
"per_page": 100,
120120
"project": [],
121121
"query": "!sentry.normalized_description:"browser-extension://*" ( span.op:resource.script OR file_extension:css OR file_extension:[woff,woff2,ttf,otf,eot] OR file_extension:[jpg,jpeg,png,gif,svg,webp,apng,avif] OR span.op:resource.img ) ",
122-
"referrer": "api.performance.browser.resources.main-table",
122+
"referrer": "api.insights.browser.resources.main-table",
123123
"sampling": "NORMAL",
124124
"sort": "-sum(span.self_time)",
125125
"statsPeriod": "10d",
@@ -177,7 +177,7 @@ const setupMockRequests = (organization: Organization) => {
177177
method: 'GET',
178178
match: [
179179
MockApiClient.matchQuery({
180-
referrer: 'api.performance.browser.resources.main-table',
180+
referrer: 'api.insights.browser.resources.main-table',
181181
}),
182182
],
183183
body: {
@@ -217,7 +217,7 @@ const setupMockRequests = (organization: Organization) => {
217217
method: 'GET',
218218
match: [
219219
MockApiClient.matchQuery({
220-
referrer: 'api.performance.browser.resources.page-selector',
220+
referrer: 'api.insights.browser.resources.page-selector',
221221
}),
222222
],
223223
body: {
@@ -230,7 +230,7 @@ const setupMockRequests = (organization: Organization) => {
230230
method: 'GET',
231231
match: [
232232
MockApiClient.matchQuery({
233-
referrer: 'api.performance.resource.resource-landing',
233+
referrer: 'api.insights.resource.resource-landing',
234234
}),
235235
],
236236
body: {
@@ -244,7 +244,7 @@ const setupMockRequests = (organization: Organization) => {
244244
requestMocks.domainSelector = MockApiClient.addMockResponse({
245245
url: `/organizations/${organization.slug}/events/`,
246246
method: 'GET',
247-
match: [MockApiClient.matchQuery({referrer: 'api.starfish.get-span-domains'})],
247+
match: [MockApiClient.matchQuery({referrer: 'api.insights.get-span-domains'})],
248248
body: {
249249
data: [{'span.domain': ['*.sentry-cdn.com'], count: 1}],
250250
},
@@ -255,7 +255,7 @@ const setupMockRequests = (organization: Organization) => {
255255
method: 'GET',
256256
match: [
257257
MockApiClient.matchQuery({
258-
referrer: 'api.performance.resource.resource-landing-series',
258+
referrer: 'api.insights.resource.resource-landing-series',
259259
}),
260260
],
261261
body: {

static/app/views/insights/browser/webVitals/queries/rawWebVitalsQueries/useProjectRawWebVitalsQuery.tsx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
import type {Tag} from 'sentry/types/group';
22
import {MutableSearch} from 'sentry/utils/tokenizeSearch';
3+
import {Referrer} from 'sentry/views/insights/browser/webVitals/referrers';
34
import {DEFAULT_QUERY_FILTER} from 'sentry/views/insights/browser/webVitals/settings';
45
import type {BrowserType} from 'sentry/views/insights/browser/webVitals/utils/queryParameterDecoders/browserType';
56
import {useSpans} from 'sentry/views/insights/common/queries/useDiscover';
@@ -45,6 +46,6 @@ export const useProjectRawWebVitalsQuery = ({
4546
'count()',
4647
],
4748
},
48-
'api.performance.browser.web-vitals.project'
49+
Referrer.WEB_VITAL_PROJECT
4950
);
5051
};

0 commit comments

Comments
 (0)