@@ -12,6 +12,7 @@ import {
1212 ComponentColor ,
1313} from '@influxdata/clockface'
1414import CloudUpgradeButton from 'src/shared/components/CloudUpgradeButton'
15+ import { SafeBlankLink } from 'src/utils/SafeBlankLink'
1516
1617// Actions
1718import { showOverlay , dismissOverlay } from 'src/overlays/actions/overlays'
@@ -22,6 +23,10 @@ import {event} from 'src/cloud/utils/reporting'
2223
2324// Utils
2425import { isFlagEnabled } from 'src/shared/utils/featureFlag'
26+ import { GoogleOptimizeExperiment } from 'src/cloud/components/experiments/GoogleOptimizeExperiment'
27+
28+ // Constants
29+ import { CREDIT_250_EXPERIMENT_ID } from 'src/shared/constants'
2530
2631interface Props {
2732 className ?: string
@@ -43,38 +48,38 @@ interface UpgradeMessageProps {
4348}
4449
4550const UpgradeMessage : FC < UpgradeMessageProps > = ( { limitText, link, type} ) => {
46- if ( isFlagEnabled ( 'credit250Experiment' ) ) {
47- return (
48- < span className = "upgrade-message" >
49- You hit the{ ' ' }
50- < a
51- href = { link }
52- className = "rate-alert--docs-link"
53- target = "_blank"
54- rel = "noreferrer"
55- >
56- { type === 'series cardinality' ? 'series cardinality' : 'query write' }
57- </ a > { ' ' }
58- limit { limitText ?? '' } and your data stopped writing. Upgrade to get a
59- free $250 credit for the first 30 days.
60- </ span >
61- )
62- }
63- return (
51+ const original = (
6452 < span className = "upgrade-message" >
6553 Oh no! You hit the{ ' ' }
66- < a
67- href = { link }
68- className = "rate-alert--docs-link"
69- target = "_blank"
70- rel = "noreferrer"
71- >
54+ < SafeBlankLink href = { link } >
7255 { type === 'series cardinality' ? 'series cardinality' : 'query write' }
73- </ a > { ' ' }
56+ </ SafeBlankLink > { ' ' }
7457 limit { limitText ?? '' } and your data stopped writing. Don't lose
7558 important metrics.
7659 </ span >
7760 )
61+
62+ if ( isFlagEnabled ( 'credit250Experiment' ) ) {
63+ return (
64+ < GoogleOptimizeExperiment
65+ experimentID = { CREDIT_250_EXPERIMENT_ID }
66+ original = { original }
67+ variants = { [
68+ < span className = "upgrade-message" key = "1" >
69+ You hit the{ ' ' }
70+ < SafeBlankLink href = { link } >
71+ { type === 'series cardinality'
72+ ? 'series cardinality'
73+ : 'query write' }
74+ </ SafeBlankLink > { ' ' }
75+ limit { limitText ?? '' } and your data stopped writing. Upgrade to
76+ get a free $250 credit for the first 30 days.
77+ </ span > ,
78+ ] }
79+ />
80+ )
81+ }
82+ return original
7883}
7984
8085export const UpgradeContent : FC < UpgradeProps > = ( {
@@ -127,14 +132,9 @@ const RateLimitAlertContent: FC<Props> = ({className, location}) => {
127132 < div className = { `${ rateLimitAlertContentClass } rate-alert--content__payg` } >
128133 < span >
129134 Data in has stopped because you've hit the{ ' ' }
130- < a
131- href = "https://docs.influxdata.com/influxdb/v2.0/write-data/best-practices/resolve-high-cardinality/"
132- className = "rate-alert--docs-link"
133- target = "_blank"
134- rel = "noreferrer"
135- >
135+ < SafeBlankLink href = "https://docs.influxdata.com/influxdb/v2.0/write-data/best-practices/resolve-high-cardinality/" >
136136 series cardinality
137- </ a > { ' ' }
137+ </ SafeBlankLink > { ' ' }
138138 limit. Let's get it flowing again.
139139 </ span >
140140 < FlexBox
0 commit comments