|
| 1 | +--- |
| 2 | +title: Build the Sample Application |
| 3 | +linkTitle: 5.1 Build the Sample Application |
| 4 | +weight: 1 |
| 5 | +--- |
| 6 | + |
| 7 | +{{% badge icon="clock" color="#ed0090" %}}10 minutes{{% /badge %}} |
| 8 | + |
| 9 | +## Introduction |
| 10 | + |
| 11 | +For this workshop, we'll be using a Java-based application called `The Door Game`. It will be hosted in Kubernetes. |
| 12 | + |
| 13 | +## Pre-requisites |
| 14 | +You will start with an EC2 instance and perform some [initial steps](#initial-steps) in order to get to the following state: |
| 15 | +* Install Kubernetes (k3s) and Docker |
| 16 | +* Deploy the **Splunk distribution of the OpenTelemetry Collector** |
| 17 | +* Build and deploy the `doorgame` application container |
| 18 | + |
| 19 | +## Initial Steps |
| 20 | + |
| 21 | +The initial setup can be completed by executing the following steps on the command line of your EC2 instance. |
| 22 | + |
| 23 | +You'll be asked to enter a name for your environment. Please use `profiling-workshop-yourname` (where `yourname` is replaced by your actual name). |
| 24 | +``` |
| 25 | +cd workshop/profiling |
| 26 | +
|
| 27 | +./1-docker-setup.sh |
| 28 | +
|
| 29 | +# Exit and ssh back to this instance |
| 30 | +
|
| 31 | +# return to the same directory as before |
| 32 | +cd workshop/profiling |
| 33 | +
|
| 34 | +# ensure Docker is running |
| 35 | +sudo systemctl start docker |
| 36 | +
|
| 37 | +./2-deploy-otel-collector.sh |
| 38 | +./3-deploy-doorgame.sh |
| 39 | +``` |
| 40 | + |
| 41 | +## Let's Play The Door Game! |
| 42 | + |
| 43 | +Now that the application is deployed, let's play with it and generate some observability data. |
| 44 | + |
| 45 | +Get the external IP address for your application instance using the following command: |
| 46 | + |
| 47 | +```` |
| 48 | +kubectl describe svc doorgame | grep "LoadBalancer Ingress" |
| 49 | +```` |
| 50 | + |
| 51 | +The output should look like the following: |
| 52 | + |
| 53 | +```` |
| 54 | +LoadBalancer Ingress: 52.23.184.60 |
| 55 | +```` |
| 56 | + |
| 57 | +You should be able to access The Door Game application by pointing your browser to port 81 of the provided IP address. For example: |
| 58 | + |
| 59 | +```` |
| 60 | +http://52.23.184.60:81 |
| 61 | +```` |
| 62 | + |
| 63 | +You should be met with The Door Game intro screen: |
| 64 | + |
| 65 | + |
| 66 | + |
| 67 | +Click `Let's Play` then choose a door: |
| 68 | + |
| 69 | + |
| 70 | + |
| 71 | +Play through a couple of times to get the feel for the application flow... and then play many times to ensure there are enough spans to create usable Profiling data... |
| 72 | + |
| 73 | +## View your application in Splunk Observability Cloud |
| 74 | + |
| 75 | +Now that the setup is complete, let's confirm that it's sending data to **Splunk Observability Cloud**. Note that when the application is deployed for the first time, it may take a few minutes for the data to appear. |
| 76 | + |
| 77 | +Navigate to APM, then use the Environment dropdown to select your environment (i.e. `profiling-workshop-name`). |
| 78 | + |
| 79 | +If everything was deployed correctly, you should see `doorgame` displayed in the list of services: |
| 80 | + |
| 81 | + |
| 82 | + |
| 83 | +Click on **Explore** on the right-hand side to view the service map. We should the `doorgame` application on the service map: |
| 84 | + |
| 85 | + |
| 86 | + |
| 87 | +Next, click on **Traces** on the right-hand side to see the traces captured for this application. You'll see that some traces run relatively fast (i.e. just a few milliseconds), whereas others take a few seconds. |
| 88 | + |
| 89 | + |
| 90 | + |
0 commit comments