Skip to content

Commit e60ba42

Browse files
vishnupsatishandrewshie-sentry
authored andcommitted
ref(feedback): add number of feedbacks as a metric when receiving feedback (#95430)
1 parent dd5b0d4 commit e60ba42

File tree

2 files changed

+7
-1
lines changed

2 files changed

+7
-1
lines changed

static/app/components/feedback/feedbackSummary.tsx

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,8 @@ import {useFeedbackForm} from 'sentry/utils/useFeedbackForm';
1212
import useOrganization from 'sentry/utils/useOrganization';
1313

1414
export default function FeedbackSummary() {
15-
const {isError, isPending, summary, tooFewFeedbacks} = useFeedbackSummary();
15+
const {isError, isPending, summary, tooFewFeedbacks, numFeedbacksUsed} =
16+
useFeedbackSummary();
1617

1718
const organization = useOrganization();
1819

@@ -39,6 +40,7 @@ export default function FeedbackSummary() {
3940
['feedback.source']: 'feedback_ai_summary',
4041
['feedback.owner']: 'replay',
4142
['feedback.type']: type,
43+
['feedback.num_feedbacks_used']: numFeedbacksUsed,
4244
},
4345
})
4446
}

static/app/components/feedback/list/useFeedbackSummary.tsx

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ type FeedbackSummaryResponse = {
1212
export default function useFeedbackSummary(): {
1313
isError: boolean;
1414
isPending: boolean;
15+
numFeedbacksUsed: number;
1516
summary: string | null;
1617
tooFewFeedbacks: boolean;
1718
} {
@@ -46,6 +47,7 @@ export default function useFeedbackSummary(): {
4647
isPending: true,
4748
isError: false,
4849
tooFewFeedbacks: false,
50+
numFeedbacksUsed: 0,
4951
};
5052
}
5153

@@ -55,6 +57,7 @@ export default function useFeedbackSummary(): {
5557
isPending: false,
5658
isError: true,
5759
tooFewFeedbacks: false,
60+
numFeedbacksUsed: 0,
5861
};
5962
}
6063

@@ -63,5 +66,6 @@ export default function useFeedbackSummary(): {
6366
isPending: false,
6467
isError: false,
6568
tooFewFeedbacks: data.numFeedbacksUsed === 0 && !data.success,
69+
numFeedbacksUsed: data.numFeedbacksUsed,
6670
};
6771
}

0 commit comments

Comments
 (0)