Deploy different versions of a go application in a real environment and visualize their performance in datadog thanks to expvar metrics.
-
Create the different versions of the app you want to test and put them into the bin folder. For example, if you're using dep, modify the constraints in the
Gopkg.toml
,dep ensure
and thengo build
your app. -
Rename your binaries by following the naming convention
APP-VERSION
. For example,nicky-develop
, wherenicky
is the name of the app anddevelop
the name of the branch. -
If you have
n
versions to compare, providen
hosts in the hosts list. The binaries will be deployed on them. -
Run the script with
./main.sh
. -
Visualize your metrics in the datadog app.
You should only provide hosts that come from the same availibility zone for better results in the comparison. You can use the datadog hostmap to visualize the hosts running your app per availibility zone.
Then inspect the page and go to network
tab, click on overview?
and save rows
as a global variable.
Then open the chrome js console and type:
hosts = temp1.filter(row => row.tags_by_source["Amazon Web Services"][0].includes("us-east-1a")).map(row => row.display_name)
hosts.forEach(h => console.log(h))
This way you'll be able to provide only the hosts for a given availibility zone.