|
@@ -19,6 +19,7 @@ import {DynamicSamplingBias, DynamicSamplingBiasType} from 'sentry/types/samplin
|
|
|
import trackAdvancedAnalyticsEvent from 'sentry/utils/analytics/trackAdvancedAnalyticsEvent';
|
|
|
import handleXhrErrorResponse from 'sentry/utils/handleXhrErrorResponse';
|
|
|
import useApi from 'sentry/utils/useApi';
|
|
|
+import {useExperiment} from 'sentry/utils/useExperiment';
|
|
|
import useOrganization from 'sentry/utils/useOrganization';
|
|
|
import SettingsPageHeader from 'sentry/views/settings/components/settingsPageHeader';
|
|
|
import TextBlock from 'sentry/views/settings/components/text/textBlock';
|
|
@@ -61,6 +62,12 @@ export const knowDynamicSamplingBiases = {
|
|
|
export function DynamicSampling({project}: Props) {
|
|
|
const organization = useOrganization();
|
|
|
const api = useApi();
|
|
|
+ const {logExperiment, experimentAssignment} = useExperiment(
|
|
|
+ 'OnboardingNewFooterExperiment',
|
|
|
+ {
|
|
|
+ logExperimentOnMount: false,
|
|
|
+ }
|
|
|
+ );
|
|
|
|
|
|
const hasTransactionNamePriorityFlag = organization.features.includes(
|
|
|
'dynamic-sampling-transaction-name-priority'
|
|
@@ -68,6 +75,14 @@ export function DynamicSampling({project}: Props) {
|
|
|
const hasAccess = organization.access.includes('project:write');
|
|
|
const biases = project.dynamicSamplingBiases ?? [];
|
|
|
|
|
|
+ // log experiment on mount if feature enabled
|
|
|
+ useEffect(() => {
|
|
|
+ // we are testing this on the dynamic sampling page but it will be removed soon
|
|
|
+ if (organization?.features.includes('onboarding-heartbeat-footer')) {
|
|
|
+ logExperiment();
|
|
|
+ }
|
|
|
+ }, [logExperiment, organization?.features]);
|
|
|
+
|
|
|
useEffect(() => {
|
|
|
trackAdvancedAnalyticsEvent('dynamic_sampling_settings.viewed', {
|
|
|
organization,
|
|
@@ -126,6 +141,16 @@ export function DynamicSampling({project}: Props) {
|
|
|
return (
|
|
|
<SentryDocumentTitle title={t('Dynamic Sampling')}>
|
|
|
<Fragment>
|
|
|
+ {organization?.features.includes('onboarding-heartbeat-footer') && (
|
|
|
+ <div>
|
|
|
+ The Heartbeat is active and you are participating in the experiment:
|
|
|
+ {experimentAssignment === 0
|
|
|
+ ? '(Baseline) No change'
|
|
|
+ : experimentAssignment === 1
|
|
|
+ ? '(Variant 1) New design with “Explore Sentry“ button disabled while “waiting for error“'
|
|
|
+ : '(Variant 2) New design with existing “View Sample Error“ button instead while “waiting for error“'}
|
|
|
+ </div>
|
|
|
+ )}
|
|
|
<SettingsPageHeader
|
|
|
title={
|
|
|
<Fragment>
|