@@ -20,6 +20,9 @@ import {shouldShowUpgradeButton} from 'src/me/selectors'
2020// reporting
2121import { event } from 'src/cloud/utils/reporting'
2222
23+ // Utils
24+ import { isFlagEnabled } from 'src/shared/utils/featureFlag'
25+
2326interface Props {
2427 className ?: string
2528 location ?: string
@@ -33,17 +36,17 @@ interface UpgradeProps {
3336 location ?: string
3437}
3538
36- export const UpgradeContent : FC < UpgradeProps > = ( {
37- type ,
38- link,
39- className ,
40- limitText ,
41- location ,
42- } ) => {
43- return (
44- < div className = { ` ${ className } rate-alert--content__free` } >
45- < span >
46- Oh no! You hit the{ ' ' }
39+ interface UpgradeMessageProps {
40+ limitText : string
41+ link : string
42+ type : string
43+ }
44+
45+ const UpgradeMessage : FC < UpgradeMessageProps > = ( { limitText , link , type } ) => {
46+ if ( isFlagEnabled ( 'credit250Experiment' ) ) {
47+ return (
48+ < span className = "upgrade-message" >
49+ You hit the{ ' ' }
4750 < a
4851 href = { link }
4952 className = "rate-alert--docs-link"
@@ -52,13 +55,42 @@ export const UpgradeContent: FC<UpgradeProps> = ({
5255 >
5356 { type === 'series cardinality' ? 'series cardinality' : 'query write' }
5457 </ a > { ' ' }
55- limit { limitText ?? '' } and your data stopped writing. Don’t lose
56- important metrics .
58+ limit { limitText ?? '' } and your data stopped writing. Upgrade to get a
59+ free $250 credit for the first 30 days .
5760 </ span >
61+ )
62+ }
63+ return (
64+ < span className = "upgrade-message" >
65+ Oh no! You hit the{ ' ' }
66+ < a
67+ href = { link }
68+ className = "rate-alert--docs-link"
69+ target = "_blank"
70+ rel = "noreferrer"
71+ >
72+ { type === 'series cardinality' ? 'series cardinality' : 'query write' }
73+ </ a > { ' ' }
74+ limit { limitText ?? '' } and your data stopped writing. Don't lose
75+ important metrics.
76+ </ span >
77+ )
78+ }
79+
80+ export const UpgradeContent : FC < UpgradeProps > = ( {
81+ type,
82+ link,
83+ className,
84+ limitText,
85+ location,
86+ } ) => {
87+ return (
88+ < div className = { `${ className } rate-alert--content__free` } >
5889 < FlexBox
5990 justifyContent = { JustifyContent . Center }
6091 className = "rate-alert--button"
6192 >
93+ < UpgradeMessage { ...{ limitText, link, type} } />
6294 < CloudUpgradeButton
6395 className = "upgrade-payg--button__rate-alert"
6496 metric = { ( ) => event ( `user.limits.${ type } .upgrade` , { location} ) }
0 commit comments