Skip to content

Commit 6e11f98

Browse files
authored
fix(insights): Filter span samples by environment (#86198)
We were not passing the environment to the samples call, so users with an environment filter set were getting samples from other environments, too! Closes #85962
1 parent ec3a6f3 commit 6e11f98

File tree

3 files changed

+4
-2
lines changed

3 files changed

+4
-2
lines changed

static/app/views/insights/common/queries/useSpanSamples.tsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -125,6 +125,7 @@ export const useSpanSamples = (options: Options) => {
125125
secondBound: maxYValue * (2 / 3),
126126
upperBound: maxYValue,
127127
project: pageFilter.selection.projects,
128+
environment: pageFilter.selection.environments,
128129
query: queryString,
129130
...(additionalFields?.length ? {additionalFields} : {}),
130131
})}`

static/app/views/insights/http/queries/useSpanSamples.spec.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ describe('useSpanSamples', () => {
3838
end: null,
3939
utc: false,
4040
},
41-
environments: [],
41+
environments: ['prod'],
4242
projects: [],
4343
},
4444
});
@@ -101,7 +101,6 @@ describe('useSpanSamples', () => {
101101
filters: {
102102
'span.group': '221aa7ebd216',
103103
release: '0.0.1',
104-
environment: undefined,
105104
},
106105
fields: [
107106
SpanIndexedField.TRANSACTION_ID,
@@ -124,6 +123,7 @@ describe('useSpanSamples', () => {
124123
query: `span.group:221aa7ebd216 release:0.0.1`,
125124
referrer: 'api-spec',
126125
statsPeriod: '10d',
126+
environment: ['prod'],
127127
lowerBound: 100,
128128
firstBound: 300,
129129
secondBound: 600,

static/app/views/insights/http/queries/useSpanSamples.tsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -74,6 +74,7 @@ export const useSpanSamples = <Fields extends SpanIndexedProperty[]>(
7474
project: selection.projects,
7575
...dateConditions,
7676
...{utc: selection.datetime.utc},
77+
environment: selection.environments,
7778
lowerBound: min,
7879
firstBound: max && max * (1 / 3),
7980
secondBound: max && max * (2 / 3),

0 commit comments

Comments
 (0)