From d5a1e957880651c7442147bd7f3156a07bca1333 Mon Sep 17 00:00:00 2001
From: Zain Asgar <zasgar@pixielabs.ai>
Date: Thu, 17 Sep 2020 15:28:57 -0700
Subject: [PATCH 1/6] Point Go demo to the docs page

---
 demos/simple-gotracing/.gitignore |   4 +-
 demos/simple-gotracing/Readme.md  | 123 +-----------------------------
 2 files changed, 5 insertions(+), 122 deletions(-)

diff --git a/demos/simple-gotracing/.gitignore b/demos/simple-gotracing/.gitignore
index dfd82748f8a..ef8d41cc18b 100644
--- a/demos/simple-gotracing/.gitignore
+++ b/demos/simple-gotracing/.gitignore
@@ -1,2 +1,4 @@
 # Ignore IDE files.
-.idea
\ No newline at end of file
+.idea
+
+app
\ No newline at end of file
diff --git a/demos/simple-gotracing/Readme.md b/demos/simple-gotracing/Readme.md
index 84b73c9b258..31793905713 100644
--- a/demos/simple-gotracing/Readme.md
+++ b/demos/simple-gotracing/Readme.md
@@ -1,124 +1,5 @@
 ## Demo of dynamic Go tracing
 
-This is a simple demo showing the ability of Pixie to add dynamic tracepoints into
-Go binaries. This capability allows debugging Go binaries in production without the need
-to instrument the source code with additional log statements, recompile, and redeploy.
+A walk through of this demo is located [here](https://docs.pixielabs.ai/tutorials/simple-go-tracing)
 
-A simple overview of this functionality is show here:
-
-![Dynamic Logs](https://storage.googleapis.com/pixie-github-content/demos/simple-gotracing/dynamic_logs.svg)
-
-In a legacy systems a modify, compile, deploy cycle is required to get visibility into the binary
-if the appropriate log lines are missing. Pixie allows
-you to dynamically capture function arguments, latency, etc., without this slow
-process.
-
-## Pre-reqs
-Pixie (>= v0.4.0) needs to be installed on your K8s cluster. If it is not already installed then
-please consult our [docs](https://docs.pixielabs.ai/).
-
-You also need to clone the `pixie` repo to get the relevant files.
-
-```bash
-git clone https://github.com/pixie-labs/pixie.git
-cd pixie/demos/simple-gotracing
-```
-
-## Running the demo
-The demo is completely self-contained and will install a simple Go application under the
-namespace px-demo-gotracing. The source of this application is in app.go. To deploy this application run:
-
-```bash
-kubectl apply -f k8s_manifest.yaml
-```
-
-We are going to dynamic trace the `computeE` function in app.go to get started. This is a simple function
-that tried to approximate the value of [eulers number](https://en.wikipedia.org/wiki/E_(mathematical_constant)) by
-using a taylor series. The number of iterations of the expansion is specified by the `iters` query param to the HTTP handler.
-To see how this works we can connect to the service by forwarding the appropriate port:
-
-```bash
-kubectl port-forward service/gotracing-svc -n px-demo-gotracing 9090
-```
-
-We can use `curl` to quickly access the api. The number of iterations is the query parameter `iters`.
-```bash
-curl http://localhost:9090/e
-# e = 2.7183
-
-curl http://localhost:9090/e\?iters\=2
-# e = 2.0000
-
-curl http://localhost:9090/e\?iters\=200
-# e = 2.7183
-```
-
-As expected the accuracy of e approaches the expected value of `2.7183` as we
-increase the number of iterations.
-
-Let's say we want to quickly access the arguments to the `computeE`
-function, and it's latency. We can use the provided `capture_args.pxl` script. As a first step we need to find
-the `UPID` of the process we want to trace. The `UPID` refers to the _unique process id_, which is a process ID that
-is globally unique in the entire cluster. In future versions of Pixie we will make this process easier. For now, we can
-easily get the `UPID` by running the follow script:
-
-```bash
-px run px/upids -- --namespace px-demo-gotracing
-
-# [0000]  INFO Pixie CLI
-# Table ID: UPIDs
-#   CLUSTERID                             POD                                           CONTAINER  UPID                                  CMDLINE  POD CREATE TIME
-#   f890689b-299c-43fd-8d2a-b0c528a58393  px-demo-gotracing/gotracing-7cdd66f89d-khnss  app        00000003-0023-9267-0000-000008e60831  ./main   2020-08-09T20:39:34-07:00
-```
-
-The relevant `UPID` is in the fourth column. Edit the `upid` variable in the `capture_args.pxl` script with this value. Alternatively, you can run the following
-shell command that will do the substitution for you:
-
-```bash
-sed -i'.orig' "s/replace-me-with-upid/$(px run -o json px/upids -- --namespace px-demo-gotracing  | jq -r '.upid' | head -n 1)/g" capture_args.pxl
-```
-
-```bash
-px run -f capture_args.pxl
-
-# [0000]  INFO Pixie CLI
-#  ✔    Preparing schema
-#  ✔    Deploying compute_e_data
-# Table ID: output
-#   CLUSTERID    UPID  TIME   GOID   ITERATIONS
-```
-
-The result data will be empty since no requests have been made yet. Let's run the curl commands we have above and see what happens:
-
-```bash
-px run -f capture_args.pxl
-
-# [0000]  INFO Pixie CLI
-# Table ID: output
-#   CLUSTERID                             UPID                                  TIME                       GOID    ITERATIONS
-#   f890689b-299c-43fd-8d2a-b0c528a58393  00000003-0024-844a-0000-000008caa618  2020-08-09T17:16:11-07:00  194529  100
-#   f890689b-299c-43fd-8d2a-b0c528a58393  00000003-0024-844a-0000-000008caa618  2020-08-09T17:16:14-07:00  194416  2
-#   f890689b-299c-43fd-8d2a-b0c528a58393  00000003-0024-844a-0000-000008caa618  2020-08-09T17:16:16-07:00  194531  200
-```
-
-There it is, we just capture all the arguments to the computeE function without changing the source code or redeploying it. We also found out
-that the default number of iterations is a 100 without having to look through the source code. While this example is straight forward and simple
-and hardly requires the use of dynamic logging to understand, we can easily see how this can be used to debug much more complicated scenarios.
-
-
-## Cleaning up
-To delete the demo from the cluster just run:
-
-```bash
-kubectl delete namespace px-demo-gotracing
-```
-
-## Modifying the demo
-The demo can easily be modified by editing the app.go source file. After that you can simply create a new
-docker image by running:
-
-```bash
-docker build . -t <image name>
-```
-
-Edit the image name in `k8s_manifest.yaml` to correspond to you new image and redeploy.
+<iframe title="youTube-aH7PHSsiIPM" src="https://www.youtube.com/embed/aH7PHSsiIPM?&amp;autoplay=false&amp;start=0" frameborder="0" allow="accelerometer; autoplay; encrypted-media; gyroscope; picture-in-picture" allowfullscreen="" />

From a5f6e40c0b48bc8028fa970c5b6cd31eaa471d4f Mon Sep 17 00:00:00 2001
From: Zain Asgar <zasgar@pixielabs.ai>
Date: Thu, 17 Sep 2020 15:31:46 -0700
Subject: [PATCH 2/6] Update Readme.md

---
 demos/simple-gotracing/Readme.md | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/demos/simple-gotracing/Readme.md b/demos/simple-gotracing/Readme.md
index 31793905713..9547ff02540 100644
--- a/demos/simple-gotracing/Readme.md
+++ b/demos/simple-gotracing/Readme.md
@@ -2,4 +2,4 @@
 
 A walk through of this demo is located [here](https://docs.pixielabs.ai/tutorials/simple-go-tracing)
 
-<iframe title="youTube-aH7PHSsiIPM" src="https://www.youtube.com/embed/aH7PHSsiIPM?&amp;autoplay=false&amp;start=0" frameborder="0" allow="accelerometer; autoplay; encrypted-media; gyroscope; picture-in-picture" allowfullscreen="" />
+[![Demo Video](https://www.youtube.com/watch?v=aH7PHSsiIPM/0.jpg)](https://www.youtube.com/watch?v=aH7PHSsiIPM)

From 26051f234f099d5316f88897d311cddcc9688942 Mon Sep 17 00:00:00 2001
From: Zain Asgar <zasgar@pixielabs.ai>
Date: Thu, 17 Sep 2020 15:32:18 -0700
Subject: [PATCH 3/6] Update Readme.md

---
 demos/simple-gotracing/Readme.md | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/demos/simple-gotracing/Readme.md b/demos/simple-gotracing/Readme.md
index 9547ff02540..695ad3e4003 100644
--- a/demos/simple-gotracing/Readme.md
+++ b/demos/simple-gotracing/Readme.md
@@ -2,4 +2,4 @@
 
 A walk through of this demo is located [here](https://docs.pixielabs.ai/tutorials/simple-go-tracing)
 
-[![Demo Video](https://www.youtube.com/watch?v=aH7PHSsiIPM/0.jpg)](https://www.youtube.com/watch?v=aH7PHSsiIPM)
+[![Demo Video](https://img.youtube.com/vi/aH7PHSsiIPM/0.jpg)](https://www.youtube.com/watch?v=aH7PHSsiIPM)

From 1eb4ae4b5bc877d26c9579bb46a600dda290b0fc Mon Sep 17 00:00:00 2001
From: Zain Asgar <zasgar@pixielabs.ai>
Date: Thu, 17 Sep 2020 15:32:34 -0700
Subject: [PATCH 4/6] Update Readme.md

---
 demos/simple-gotracing/Readme.md | 1 +
 1 file changed, 1 insertion(+)

diff --git a/demos/simple-gotracing/Readme.md b/demos/simple-gotracing/Readme.md
index 695ad3e4003..b382bd4c150 100644
--- a/demos/simple-gotracing/Readme.md
+++ b/demos/simple-gotracing/Readme.md
@@ -2,4 +2,5 @@
 
 A walk through of this demo is located [here](https://docs.pixielabs.ai/tutorials/simple-go-tracing)
 
+Youtube Video:
 [![Demo Video](https://img.youtube.com/vi/aH7PHSsiIPM/0.jpg)](https://www.youtube.com/watch?v=aH7PHSsiIPM)

From 21dc75fae4d1e094d7f258156e2a1b1d51c67069 Mon Sep 17 00:00:00 2001
From: Zain Asgar <zasgar@pixielabs.ai>
Date: Thu, 17 Sep 2020 15:32:52 -0700
Subject: [PATCH 5/6] Update Readme.md

---
 demos/simple-gotracing/Readme.md | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/demos/simple-gotracing/Readme.md b/demos/simple-gotracing/Readme.md
index b382bd4c150..c420df27cd0 100644
--- a/demos/simple-gotracing/Readme.md
+++ b/demos/simple-gotracing/Readme.md
@@ -1,6 +1,6 @@
-## Demo of dynamic Go tracing
+## Demo of Dynamic Go Tracing
 
 A walk through of this demo is located [here](https://docs.pixielabs.ai/tutorials/simple-go-tracing)
 
-Youtube Video:
+## Youtube Video:
 [![Demo Video](https://img.youtube.com/vi/aH7PHSsiIPM/0.jpg)](https://www.youtube.com/watch?v=aH7PHSsiIPM)

From a1bd44c7378fa5c8f4b6ce158d9521ffdfe569a1 Mon Sep 17 00:00:00 2001
From: Zain Asgar <zasgar@pixielabs.ai>
Date: Thu, 17 Sep 2020 15:33:00 -0700
Subject: [PATCH 6/6] Update Readme.md

---
 demos/simple-gotracing/Readme.md | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/demos/simple-gotracing/Readme.md b/demos/simple-gotracing/Readme.md
index c420df27cd0..3f8273fce55 100644
--- a/demos/simple-gotracing/Readme.md
+++ b/demos/simple-gotracing/Readme.md
@@ -2,5 +2,5 @@
 
 A walk through of this demo is located [here](https://docs.pixielabs.ai/tutorials/simple-go-tracing)
 
-## Youtube Video:
+### Youtube Video:
 [![Demo Video](https://img.youtube.com/vi/aH7PHSsiIPM/0.jpg)](https://www.youtube.com/watch?v=aH7PHSsiIPM)
