This project is a polyglot demo application with several services to show you how to send your data and view the data on Tanzu Observability.
To view data in Tanzu Observability by Wavefront, you need:
- A Tanzu Observability account. If you don't have an account, register for the free trial.
- Get the API token and the URL of your instance. For more information, see Managing API Tokens.
You can:
- Deploy with helm or kubectl using the preconfigured containers on
public.ecr.aws/tanzu_observability_demo_app/to-demo
- You can also build, package and push to your registry and deploy from there.
You need an environment configured to run Kubernetes. See Install Tools on the Kubernetes Documentation for details.
-
Clone the repo:
git clone https://github.com/wavefrontHQ/demo-app.git cd demo-app/deploy/helm
-
Edit
values.yaml
to match your environment:vi values.yaml
-
Enter the API Token and URL of your instance:
wavefront: token: url:
-
Optionally, to send logs to Tanzu Observability with
fluentd
, updatevalues.yaml
and set logs totrue
:logs: enabled: true
-
Install with Helm:
helm install tacocat-demo .
-
Verify that the pods are running.
Example:
k get pods -n tanzu-observability-demo ~/l/d/d/helm ❯❯❯ k get pods -n tanzu-observability-demo NAME READY STATUS RESTARTS AGE delivery-blue-764995948c-7g6vn 1/1 Running 0 14m delivery-green-867f978c5f-gftdt 1/1 Running 0 13m inventory-blue-b86c59d8d-sv2gg 1/1 Running 0 13m inventory-green-85679dc4c6-lrhd5 1/1 Running 0 13m loadgen-65676c865b-hkffn 1/1 Running 0 12m notification-blue-5668c6df94-cpvlm 1/1 Running 0 13m notification-green-76895b75d6-tqr84 1/1 Running 0 14m packaging-blue-5775f7c86f-tccsc 1/1 Running 0 14m packaging-green-7cb5644df7-f766l 1/1 Running 0 14m payments-blue-7486b5bd59-8rggp 1/1 Running 0 14m payments-green-5bdf5869bc-447xf 1/1 Running 0 14m printing-blue-9fb48997d-bwsqx 1/1 Running 0 14m printing-green-7f66cd9bfd-npglt 1/1 Running 0 14m shopping-blue-68b89984fd-x52bg 1/1 Running 0 13m shopping-green-666dcc6966-lgmrp 1/1 Running 0 14m styling-blue-64dbc49f5b-2wrg4 1/1 Running 0 14m styling-green-75789ddc76-k77nx 1/1 Running 0 14m tanzu-observability-demo-wavefront-proxy-65c544fdd-6959p 1/1 Running 0 14m warehouse-blue-6cb8f5c988-ltpgv 1/1 Running 0 14m warehouse-green-5b65b7d764-z8g6n 1/1 Running 0 14m
You can build the application and run it locally on your machine or on Docker.
- Bash or zsh
- envsubst
- Clone the repo:
git clone https://github.com/wavefrontHQ/demo-app.git
cd demo-app
- Configure
deploy/src/values.sh
with your settings:
export K8S_NAMESPACE=tacocat
export K8S_APPLICATION=tacocat
export K8S_CLUSTER=cluster1
export K8S_LOCATION=americas
export K8S_REPOSITORY=public.ecr.aws/tanzu_observability_demo_app/to-demo/
export WAVEFRONT_BASE64_TOKEN=<YOUR BASE64 ENCODED TOKEN HERE>
export WF_PROXY_HOST=${K8S_NAMESPACE}-wavefront-proxy
- The variables in
values.sh
are used to configure values for theyaml
files.K8S_REPOSITORY
is the repository URL for container images. The repository URL needs to be specified for the deployment to properly download the images.- If you use the value that is already defined for
K8S_REPOSITORY
, skip the build and package steps. If running locally withdocker-compose
, you do not need theK8S_REPOSITORY
settings:
```
#export K8S_REPOSITORY=public.ecr.aws/tanzu_observability_demo_app/to-demo/
export WF_PROXY_HOST=wavefront-proxy
```
- Generate the YAML files.
cd deploy/src
./cm.sh
cm.sh
creates the 01-app-config-*.yaml files and runscreate-yaml.sh
which usesenvsubst
andvalues.sh
to configure all of the*yaml
files.- You must run this step before building the images as it also creates
applicationTag.yaml
files used by theservices.*
.
Build the Java services from the root folder:
mvn clean package
The .Net service (Payments) and the Golang service (inventory) are built when creating the docker container in the Package step.
Note: This step pushes data to the registry defined in
K8S_REPOSITORY
.To run locally with
docker-compose
,K8S_REPOSITORY
should be undefined or empty.
Create docker images and push them to the registry (if K8S_REPOSITORY
is set).
cd ../images-k8s
./all.sh
You can deploy they application using docker-compose
or kubectl
.
- Navigate to the
docker-compose
directory.cd deploy/docker-compose
- Edit
docker-compose.yaml
and update theWAVEFRONT PROXY
settings:wavefront-proxy: image: projects.registry.vmware.com/tanzu_observability/proxy:latest container_name: wavefront-proxy environment: - WAVEFRONT_URL=https://[YOUR TENANT].wavefront.com/api - WAVEFRONT_TOKEN=[YOUR API KEY]
- Deploy the application.
- Deploy using local containers:
docker-compose up -d
- Or deploy using hosted containers:
export export K8S_REPOSITORY=public.ecr.aws/tanzu_observability_demo_app/to-demo/; docker-compose up -d
- Deploy using local containers:
- Verify that the containers are running:
~/l/d/d/docker-compose ❯❯❯ docker-compose ps ✘ 130 Name Command State Ports ---------------------------------------------------------------------------------------------------------------------- delivery java -jar /delivery.jar -- ... Up docker-compose_loadgen_1 java -jar /loadgen.jar sho ... Up inventory /inventory /conf/inventory ... Up notfication java -jar /notification.ja ... Up packaging java -jar /packaging.jar / ... Up payments dotnet run --no-build -p / ... Up printing java -jar /printing.jar /c ... Up shopping java -jar /shopping.jar se ... Up 0.0.0.0:50050->50050/tcp, 0.0.0.0:50150->50150/tcp styling java -jar /styling.jar ser ... Up warehouse python3 manage.py runserve ... Up wavefront-proxy /bin/bash /opt/wavefront/w ... Up 2878/tcp, 3878/tcp, 4242/tcp ```
- The yaml files are split into
deploy
,namespace
, andservices
folders. - With this folder structure, you can redeploy the apps in the
deploy
folder without changing the Kubernetes service or namespace.
Follow these steps:
- Deploy the namespace first:
kubectl apply -f namespace/
- Deploy the Wavefront proxy and shopping service:
kubectl apply -f services/
- Deploy the app:
kubectl apply -f .
- To redeploy (but not delete the namespace or service):
kubectl delete -f . kubectl apply -f .
Once the data is sent, you can:
- Create charts and dashboards to monitor data.
- Create alerts and get notified when the system notices data anomalies.
- Get an overview of how the applications and services are linked using the Application Map.
- Explore the context and the details of your application’s traces using the Traces Browser.
- See the logs and find the root cause of issues using the Logs Browser.
See our documentation for details.
Please let us know how we can improve!
If you have problems with this application, let us know by creating a GitHub issue.