Skip to content

Commit

Permalink
docs: update emojivoto example (#129)
Browse files Browse the repository at this point in the history
* remove launcher, rename image

* simplify readme on example app

* emoji: remove version to use local image

* emoji: update readme for local docker image

---------

Co-authored-by: Mike Goldsmith <[email protected]>
  • Loading branch information
JamieDanielson and MikeGoldsmith authored May 2, 2023
1 parent ed6f140 commit 29ac2af
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 92 deletions.
30 changes: 19 additions & 11 deletions docs/getting-started/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,14 @@ The following tools are required to run this tutorial:
- [Kind](https://kind.sigs.k8s.io/) to run a local Kubernetes cluster with Docker container nodes.
- [Kubernetes CLI (kubectl)](https://kubernetes.io/docs/tasks/tools/install-kubectl/) to run commands against Kubernetes clusters.

## Local build

From the root directory, build the tool as a local docker image called `otel-go-instrumentation`:

```shell
make docker-build
```

## Creating the Kubernetes cluster

Create a new local Kubernetes cluster, by running the following command:
Expand All @@ -17,6 +25,12 @@ Create a new local Kubernetes cluster, by running the following command:
kind create cluster
```

Load the docker image into Kind:

```shell
kind load docker-image otel-go-instrumentation
```

## Deployment

The Kubernetes cluster will run the emojivoto applications and a jaeger UI for visualizing the OpenTelemetry traces:
Expand All @@ -30,15 +44,15 @@ The different emojivoto applications are communicating via gRPC. Instrumenting t
Run the following command:

```shell
kubectl apply -k github.com/open-telemetry/opentelemetry-go-instrumentation/docs/getting-started/emojivoto
kubectl apply -k emojivoto/
```

### Deploying Jaeger UI

Install Jaeger UI by running:

```shell
kubectl apply -f https://raw.githubusercontent.com/open-telemetry/opentelemetry-go-instrumentation/master/docs/getting-started/jaeger.yaml -n emojivoto
kubectl apply -f jaeger.yaml -n emojivoto
```

This command installs Jaeger as a new Deployment and an additional Service that we will use later for accessing the Jaeger UI.
Expand All @@ -50,12 +64,12 @@ In a real world application, you would probably want to send the tracing data to
Apply the automatic instrumentation to the `emoji`, `voting`, and `web` applications by executing the following command:

```shell
kubectl apply -f https://raw.githubusercontent.com/open-telemetry/opentelemetry-go-instrumentation/master/docs/getting-started/emojivoto-instrumented.yaml -n emojivoto
kubectl apply -f emojivoto-instrumented.yaml -n emojivoto
```

## Perform actions on the target Application

Now all that left to do is to perform some actions on the target application that will cause the creation of detailed distributed traces.
Now all that's left to do is to perform some actions on the target application that will cause the creation of detailed distributed traces.

Port forward to the frontend service:

Expand Down Expand Up @@ -97,13 +111,7 @@ We can get a pretty good understanding of how the leaderboard feature works by l
- Second, The web service will loop over the received list of emojis and for every item on the list it will perform a gRPC request to the `emoji` service to get the amount of votes for the current item.
- As you can see this happens sequentially, which is one of the reason the leaderboard endpoint takes about 150ms to complete.

### Notice that we did not change any application code to get those traces, we are using the exact same containers from the emojivoto project.

## Next Steps

The easiest way to apply this automatic instrumentation for any application is by using a control plane such as [Odigos](https://github.com/keyval-dev/odigos).

For more details visit the [Odigos website](https://odigos.io).
**Notice that we did not change any application code to get those traces, we are using the exact same containers from the emojivoto project.**

## Cleanup

Expand Down
84 changes: 3 additions & 81 deletions docs/getting-started/emojivoto-instrumented.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -22,17 +22,6 @@ spec:
serviceAccountName: emoji
shareProcessNamespace: true
terminationGracePeriodSeconds: 0
initContainers:
- name: copy-launcher
image: keyval/launcher:v0.1
command:
- cp
- -a
- /kv-launcher/.
- /odigos-launcher/
volumeMounts:
- name: launcherdir
mountPath: /odigos-launcher
containers:
- env:
- name: GRPC_PORT
Expand All @@ -41,12 +30,6 @@ spec:
value: "8801"
image: docker.l5d.io/buoyantio/emojivoto-emoji-svc:v11
name: emoji-svc
command:
- /odigos-launcher/launch
- /usr/local/bin/emojivoto-emoji-svc
volumeMounts:
- mountPath: /odigos-launcher
name: launcherdir
ports:
- containerPort: 8080
name: grpc
Expand All @@ -56,7 +39,7 @@ spec:
requests:
cpu: 100m
- name: emojivoto-emoji-instrumentation
image: keyval/otel-go-agent:v0.6.0
image: otel-go-instrumentation
env:
- name: OTEL_GO_AUTO_TARGET_EXE
value: /usr/local/bin/emojivoto-emoji-svc
Expand All @@ -70,15 +53,6 @@ spec:
add:
- SYS_PTRACE
privileged: true
volumeMounts:
- mountPath: /sys/kernel/debug
name: kernel-debug
volumes:
- name: launcherdir
emptyDir: {}
- name: kernel-debug
hostPath:
path: /sys/kernel/debug
---
apiVersion: apps/v1
kind: Deployment
Expand All @@ -104,17 +78,6 @@ spec:
serviceAccountName: voting
shareProcessNamespace: true
terminationGracePeriodSeconds: 0
initContainers:
- name: copy-launcher
image: keyval/launcher:v0.1
command:
- cp
- -a
- /kv-launcher/.
- /odigos-launcher/
volumeMounts:
- name: launcherdir
mountPath: /odigos-launcher
containers:
- env:
- name: GRPC_PORT
Expand All @@ -123,12 +86,6 @@ spec:
value: "8801"
image: docker.l5d.io/buoyantio/emojivoto-voting-svc:v11
name: voting-svc
command:
- /odigos-launcher/launch
- /usr/local/bin/emojivoto-voting-svc
volumeMounts:
- mountPath: /odigos-launcher
name: launcherdir
ports:
- containerPort: 8080
name: grpc
Expand All @@ -138,7 +95,7 @@ spec:
requests:
cpu: 100m
- name: emojivoto-voting-instrumentation
image: keyval/otel-go-agent:v0.6.0
image: otel-go-instrumentation
env:
- name: OTEL_GO_AUTO_TARGET_EXE
value: /usr/local/bin/emojivoto-voting-svc
Expand All @@ -152,15 +109,6 @@ spec:
add:
- SYS_PTRACE
privileged: true
volumeMounts:
- mountPath: /sys/kernel/debug
name: kernel-debug
volumes:
- name: launcherdir
emptyDir: {}
- name: kernel-debug
hostPath:
path: /sys/kernel/debug
---
apiVersion: apps/v1
kind: Deployment
Expand All @@ -186,17 +134,6 @@ spec:
serviceAccountName: web
shareProcessNamespace: true
terminationGracePeriodSeconds: 0
initContainers:
- name: copy-launcher
image: keyval/launcher:v0.1
command:
- cp
- -a
- /kv-launcher/.
- /odigos-launcher/
volumeMounts:
- name: launcherdir
mountPath: /odigos-launcher
containers:
- env:
- name: WEB_PORT
Expand All @@ -209,20 +146,14 @@ spec:
value: dist/index_bundle.js
image: docker.l5d.io/buoyantio/emojivoto-web:v11
name: web-svc
command:
- /odigos-launcher/launch
- /usr/local/bin/emojivoto-web
volumeMounts:
- mountPath: /odigos-launcher
name: launcherdir
ports:
- containerPort: 8080
name: http
resources:
requests:
cpu: 100m
- name: emojivoto-web-instrumentation
image: keyval/otel-go-agent:v0.6.0
image: otel-go-instrumentation
env:
- name: OTEL_GO_AUTO_TARGET_EXE
value: /usr/local/bin/emojivoto-web
Expand All @@ -236,12 +167,3 @@ spec:
add:
- SYS_PTRACE
privileged: true
volumeMounts:
- mountPath: /sys/kernel/debug
name: kernel-debug
volumes:
- name: launcherdir
emptyDir: {}
- name: kernel-debug
hostPath:
path: /sys/kernel/debug

0 comments on commit 29ac2af

Please sign in to comment.