This is a multi-language/framework project that implements Empower Plant web app. It has one actively maintained frontend, react
, that can connect to any one of the backend implementations using a query string parameter (e.g. ?backend=express
) and uses flask
by default.
Currently deployed to: https://application-monitoring-react-dot-sales-engineering-sf.appspot.com/
https://www.notion.so/sentry/Demo-Data-Requirements-4b918453be6f4e4fbdcfd4b2e3e608e0
Add at least 1 item to Cart and purchase in order to trigger an Error. Visit the routes defined in src/index.js to produce transactions.
Query params to be added to the demo app. These query parameters can be stacked on top of one another
?backend=flask
- sets the backend url (we have multiple backends with similar functionality). Here are all the options for backends). Additionally recorded in backendType
tag. Defaults to: flask?userFeedback=true
- displays (old) user feedback modal 5 seconds after checkout crash.?se=<yourname
- put your name here, for example ?se=chris
, ?se=kosty
, etc. This results in an se
tag added to events triggered during the demo, and adjust the fingerprint to segment issues depending on the SE.?crash=true
- forces a crash of one of predefined types, selected randomly.?crash=true&errnum=3
- forces crash of specific type depending on errnum
value?userEmail=someemail@example.com
- lets you pass in a specific user email?frontendSlowdown=true
- used in the frontend-only demo flow, which showcases a frontend slowdown via profiling.?rageclick=true
- causes the checkout button to stop working, so you can rageclick it. This will prevent the checkout error from happening. If you want to still demo the checkout error AND a rageclick, you can rageclick manually on the 'Contact Us' button that shows on the page after the Checkout Error occurs.# example
https://localhost:5000/?se=chris&backend=flask&frontendSlowdown=true
While not an Empower React app query param, we also have demo-specific query params to customize Sentry UI experience. Those have to be set in the Sentry app itself.
&issueTracking=jira
- only shows 1 issue integration instead of all ~10 (for examples, see internal documentation)The user feedback widget is enabled on all pages, in the bottom-right corner. Submit user feedback from any page to have it show up in Sentry.
deploy.sh
file.local.env
from empower-config into env-config
directory of your local repo, or, if you don't have access to it, follow env-config/example.env
.REACT_APP_FLASK_BACKEND
in env-config/local.env
points to the backend instance deployed to AppEngine, the same one used by the cloud-hosted React web app. Flask is the default backend. If you expect to run other backend types, add values for those in env-config
in your local.env
file as well (i.e. REACT_APP_EXPRESS_BACKEND
).brew -v
. If not, install using /bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
.Postgres -V
. If not, install using brew install postgresql
.node
and npm
, install the following to be able to set the specific versions required (below describes how to achieve it using n
package, but alternatively you can use nvm
):
npm
version with npm install -g npm@XX.XX.XX
. NOTE: may need to use sudo
with command.n
to update node
version with npm install -g n
.node
version with n XX.XX.XX
. NOTE: may need to use sudo
with command.CLI
using this document.gcloud init
. When prompted, choose the project sales-engineering-sf
.Following sub-projects might not work with deploy.sh
at this moment. Consult their README's for how to run and deploy them (and feel free to submit a PR that fixes it):
NOTE: build.sh
and run.sh
files in each project are not meant to be run directly, use top-level deploy.sh
instead because it sets all required environment variables.
If you run locally and only deploy react
it will point to staging
backends, however if you include a backend
projects in the command react
will magically point to it instead of staging (still requires &backend=<backend>
url param).
deploy.sh
takes another argument --env=<env>
, which can be either local
, staging
or production
. Each value corresponds to a file in env-config
directory. local
is a special value, most significantly it will run all webservers locally instead of deploying to Google App Engine.
deploy.sh
does everything including validating that all required values are set in the env-config/*.env
, that each project's DSN and project name point to the same project, and that you are not accidentally deploying to production, etc.
Pick one of two ways to run the React app:
Recommended to use this command rather than npm start
, as deploy.sh uploads source maps and handles crashes more realistically.
./deploy.sh --env=local react flask
or
./deploy.sh react --env=local
NOTE: this will cause crashing errors to be tagged in sentry as handled (handled: true
)
cd react
../env.sh local npm start
This script deploys the flagship apps React + Flask. For deploying a single app to App Engine, check each platform's README for specific instructions. Make sure you don't have any local changes to env-config/production.env
.
./deploy.sh react --env=production
You can put all 4 apps in deploy.sh for deployment, but that's 4 apps you could be taking down at once, which other people are relying on. With great power, comes great responsibility.
Run gcloud auth login
if it asks you to authenticate, or insert YubiKey.
./deploy.sh react flask vue --env=staging
## Check if you're on your fork. If so, you should see:
git remote -v
origin git@github.com:<your_handle>/empower.git (fetch)
origin git@github.com:<your_handle>/empower.git (push)
upstream git@github.com:sentry-demos/empower.git (fetch)
upstream git@github.com:sentry-demos/empower.git (push)
# If you don't have an upstream
git remote add upstream git@github.com:sentry-demos/empower.git
# Make sure you're on master
git checkout master
# get updates from the upstream
git fetch upstream master
git merge upstream/master
# merge those updates into your current branch, if it's behind
git checkout yourbranch
git merge master
See troubleshooting
gcloud app versions list
gcloud app deploy
gcloud app browse
gcloud app services list
gcloud app logs tail -s application-monitoring-react
gcloud app logs tail -s application-monitoring-flask
gcloud --help
gcloud topic configurations
gcloud auth
gcloud auth application-default
gcloud auth login
gcloud auth list
gcloud config set account `ACCOUNT`
gcloud config list, to display current account
gcloud app deploy
does not support --update-env-vars RELEASE=$RELEASE
like gcloud run deploy
does with Cloud Run