import {Fragment} from 'react';
import styled from '@emotion/styled';
import {Alert} from 'sentry/components/alert';
import FeatureBadge from 'sentry/components/badge/featureBadge';
import {LinkButton} from 'sentry/components/button';
import SentryDocumentTitle from 'sentry/components/sentryDocumentTitle';
import {t} from 'sentry/locale';
import {space} from 'sentry/styles/space';
import {hasDynamicSamplingCustomFeature} from 'sentry/utils/dynamicSampling/features';
import useOrganization from 'sentry/utils/useOrganization';
import SettingsPageHeader from 'sentry/views/settings/components/settingsPageHeader';
import {OrganizationSampling} from 'sentry/views/settings/dynamicSampling/organizationSampling';
import {ProjectSampling} from 'sentry/views/settings/dynamicSampling/projectSampling';
import {useHasDynamicSamplingWriteAccess} from 'sentry/views/settings/dynamicSampling/utils/access';
export default function DynamicSamplingSettings() {
const organization = useOrganization();
const hasWriteAccess = useHasDynamicSamplingWriteAccess();
if (!hasDynamicSamplingCustomFeature(organization)) {
return {t("You don't have access to this feature")};
}
return (
{t('Dynamic Sampling')}
}
action={
{t('Read the docs')}
}
/>
{!hasWriteAccess && (
{t(
'These settings can only be edited by users with the organization owner or manager role.'
)}
)}
{t(
'Dynamic Sampling lets you manage span storage in Sentry. This prioritizes important events and increases visibility into lower-volume projects, keeping the most relevant data while minimizing redundancy. You can customize sample rates and priorities in the settings to control which data is retained.'
)}
{organization.samplingMode === 'organization' ? (
) : (
)}
);
}
const Paragraph = styled('p')`
margin-bottom: ${space(1.5)};
`;