MCPcopy Index your code
hub / github.com/getsentry/sentry / getRuleType

Function getRuleType

static/gsAdmin/views/dynamicSamplingPanel.tsx:80–106  ·  view source on GitHub ↗
({id}: RuleV2)

Source from the content-addressed store, hash-verified

78}
79
80const getRuleType = ({id}: RuleV2): RuleType | undefined => {
81 const RESERVED_IDS = {
82 1000: RuleType.BOOST_LOW_VOLUME_PROJECTS,
83 1001: RuleType.BOOST_ENVIRONMENTS,
84 1002: RuleType.IGNORE_HEALTH_CHECKS,
85 1003: RuleType.BOOST_KEY_TRANSACTIONS,
86 1004: RuleType.RECALIBRATION_RULE,
87 1005: RuleType.BOOST_REPLAY_ID,
88 1006: RuleType.MINIMUM_SAMPLE_RATE_TARGET,
89 };
90
91 if (id in RESERVED_IDS) {
92 // @ts-expect-error TS(7053): Element implicitly has an 'any' type because expre... Remove this comment to see the full error message
93 return RESERVED_IDS[id];
94 }
95 if (id >= 1400 && id < 1500) {
96 return RuleType.REBALANCE_TRANSACTIONS;
97 }
98 if (id >= 1500 && id < 1600) {
99 return RuleType.BOOST_LATEST_RELEASES;
100 }
101 if (id >= 3000 && id < 5000) {
102 return RuleType.INVESTIGATION_RULE;
103 }
104
105 return undefined;
106};
107
108function getStringifiedCondition(condition: Record<string, any>): string {
109 const inner = Array.isArray(condition.inner) ? condition.inner : [condition.inner];

Callers 3

DynamicSamplingPanelBodyFunction · 0.85
evaluateRuleImpactFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected