index.tsx 1.6 KB

12345678910111213141516171819202122232425262728293031323334353637
  1. import {Fragment} from 'react';
  2. import {Alert} from 'sentry/components/alert';
  3. import SentryDocumentTitle from 'sentry/components/sentryDocumentTitle';
  4. import {t} from 'sentry/locale';
  5. import {hasDynamicSamplingCustomFeature} from 'sentry/utils/dynamicSampling/features';
  6. import useOrganization from 'sentry/utils/useOrganization';
  7. import SettingsPageHeader from 'sentry/views/settings/components/settingsPageHeader';
  8. import {OrganizationSampling} from 'sentry/views/settings/dynamicSampling/organizationSampling';
  9. import {ProjectSampling} from 'sentry/views/settings/dynamicSampling/projectSampling';
  10. export default function DynamicSamplingSettings() {
  11. const organization = useOrganization();
  12. if (!hasDynamicSamplingCustomFeature(organization)) {
  13. return <Alert type="warning">{t("You don't have access to this feature")}</Alert>;
  14. }
  15. return (
  16. <Fragment>
  17. <SentryDocumentTitle title={t('Dynamic Sampling')} orgSlug={organization.slug} />
  18. <div>
  19. <SettingsPageHeader title={t('Dynamic Sampling')} />
  20. <p>
  21. {t(
  22. 'Dynamic sampling adaptively reduces the number of spans stored in Sentry without changing SDK sample rates. It allows you to keep the most relevant samples and obtain accurate high-level insights while limiting redundancy and stored span volume. You can customize sample rates and priorities in these settings to control which data is stored.'
  23. )}
  24. </p>
  25. {organization.samplingMode === 'organization' ? (
  26. <OrganizationSampling />
  27. ) : (
  28. <ProjectSampling />
  29. )}
  30. </div>
  31. </Fragment>
  32. );
  33. }