diff --git a/docker/Dockerfile.chronograf b/docker/Dockerfile.chronograf index 4ee3a26ff2..d0ceb6a977 100644 --- a/docker/Dockerfile.chronograf +++ b/docker/Dockerfile.chronograf @@ -27,6 +27,7 @@ ENV GLOBALSEARCH_API_KEY= ENV GLOBALSEARCH_APP_ID= # Google Experiments ENV vars ENV PAYG_CREDIT_EXPERIMENT_ID= +ENV CREDIT_250_EXPERIMENT_ID= # This is the origin of the URL needed to access the running container (optional) # ENV PUBLIC=http://foobar diff --git a/docker/Dockerfile.chronograf.prod b/docker/Dockerfile.chronograf.prod index 17ab13c03e..eb165958f4 100644 --- a/docker/Dockerfile.chronograf.prod +++ b/docker/Dockerfile.chronograf.prod @@ -40,6 +40,8 @@ ARG GLOBALSEARCH_API_KEY ARG GLOBALSEARCH_APP_ID # Google Experiment ID for PAYG $250 Credit ARG PAYG_CREDIT_EXPERIMENT_ID +# Google Experiment ID for Get $250 Credit +ARG CREDIT_250_EXPERIMENT_ID COPY . /repo/ui WORKDIR /repo/ui diff --git a/src/cloud/components/RateLimitAlertContent.tsx b/src/cloud/components/RateLimitAlertContent.tsx index 242aa151b3..a19070e5d3 100644 --- a/src/cloud/components/RateLimitAlertContent.tsx +++ b/src/cloud/components/RateLimitAlertContent.tsx @@ -12,6 +12,7 @@ import { ComponentColor, } from '@influxdata/clockface' import CloudUpgradeButton from 'src/shared/components/CloudUpgradeButton' +import {SafeBlankLink} from 'src/utils/SafeBlankLink' // Actions import {showOverlay, dismissOverlay} from 'src/overlays/actions/overlays' @@ -22,6 +23,10 @@ import {event} from 'src/cloud/utils/reporting' // Utils import {isFlagEnabled} from 'src/shared/utils/featureFlag' +import {GoogleOptimizeExperiment} from 'src/cloud/components/experiments/GoogleOptimizeExperiment' + +// Constants +import {CREDIT_250_EXPERIMENT_ID} from 'src/shared/constants' interface Props { className?: string @@ -43,38 +48,38 @@ interface UpgradeMessageProps { } const UpgradeMessage: FC = ({limitText, link, type}) => { - if (isFlagEnabled('credit250Experiment')) { - return ( - - You hit the{' '} - - {type === 'series cardinality' ? 'series cardinality' : 'query write'} - {' '} - limit {limitText ?? ''} and your data stopped writing. Upgrade to get a - free $250 credit for the first 30 days. - - ) - } - return ( + const original = ( Oh no! You hit the{' '} - + {type === 'series cardinality' ? 'series cardinality' : 'query write'} - {' '} + {' '} limit {limitText ?? ''} and your data stopped writing. Don't lose important metrics. ) + + if (isFlagEnabled('credit250Experiment')) { + return ( + + You hit the{' '} + + {type === 'series cardinality' + ? 'series cardinality' + : 'query write'} + {' '} + limit {limitText ?? ''} and your data stopped writing. Upgrade to + get a free $250 credit for the first 30 days. + , + ]} + /> + ) + } + return original } export const UpgradeContent: FC = ({ @@ -127,14 +132,9 @@ const RateLimitAlertContent: FC = ({className, location}) => {
Data in has stopped because you've hit the{' '} - + series cardinality - {' '} + {' '} limit. Let's get it flowing again. = ({ history.push('/checkout') } - const promoMessage = - isFlagEnabled('credit250Experiment') && showPromoMessage ? ( - - Get $250 free credit - - ) : null + const original = showUpgradeButton && ( +