Created
December 25, 2022 21:41
-
-
Save vfarcic/38b4b02bef304fc98c519f6dd6074545 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Source: https://gist.github.com/38b4b02bef304fc98c519f6dd6074545 | |
##################################################### | |
# You MUST Instrument Your Code With OpenTelemetry! # | |
# https://youtu.be/oe5YYh9mhzw # | |
##################################################### | |
# Additional Info: | |
# - OpenTelemetry: https://opentelemetry.io | |
######### | |
# Setup # | |
######### | |
# Create a Kubernetes cluster | |
git clone https://github.com/vfarcic/silly-demo | |
cd silly-demo | |
kubectl create namespace production | |
################################################ | |
# What Is OpenTelemetry And Why Do We Need It? # | |
################################################ | |
cat main.go | |
# Open https://opentelemetry.io/registry | |
cat opentelemetry.go | |
kubectl kustomize --enable-helm \ | |
kustomize/overlays/stateful-db \ | |
| kubectl --namespace production apply --filename - | |
export POD_NAME=$(kubectl --namespace production get pods \ | |
--selector "app.kubernetes.io/name=silly-demo" \ | |
--output name) | |
kubectl --namespace production exec --stdin --tty \ | |
$POD_NAME -- cat traces.json | |
########### | |
# Destroy # | |
########### | |
kubectl delete namespace production | |
cd .. | |
rm -rf silly-demo | |
# Destroy or reset the cluster |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment