DataDog / ecommerce-workshop

Example eCommerce App for workshops and observability
Other
89 stars 112 forks source link

Auto-generate RUM data #155

Open stevedatadog opened 3 years ago

stevedatadog commented 3 years ago

Script a headless browser to interact with the Storedog UI. Perhaps part of the traffic container? Selenium, PhantomJS, etc.

stevedatadog commented 3 years ago

@obensource and @ryanmaclean are working on a solution using puppeteer.

stevedatadog commented 3 years ago

We have a solution for this that uses a 3rd party docker image and two custom scripts. The container will run puppeteer.sh, which in turn runsnode puppeteer.js in an infinite loop. puppeteer.js clicks on a bunch of Storedog UI selectors across multiple pages:

 puppeteer:
    image: buildkite/puppeteer:10.0.0
    volumes:
      - /root/puppeteer-mobile.js:/puppeteer.js
      - /root/puppeteer.sh:/puppeteer.sh
    environment: 
      - RUM_START_URL
    depends_on:
      - frontend
    command: bash puppeteer.sh

This is probably not general-purpose enough to add by default to the stack, but it's a good starting point for a flexible solution.

stanleegoodspeed commented 2 years ago

@stevedatadog is there a working branch for this? I can try and pick this up if need be

stevedatadog commented 2 years ago

Here's one example in our Learning Center scenarios used in Dash workshops. The docker-compose.yml file has a block like the one I pasted above. The JS and Bash scripts are in there, too. Maybe our own image complete with those scripts? Users could then mount their own scripts on top of the defaults for custom behavior.

stevedatadog commented 2 years ago

In our cross-team meeting today, we resolved that we will deprecate traffic-replay in favor of a puppeteer alternative. The new puppeteer image must: