Skip to content

Instantly share code, notes, and snippets.

@vfarcic
Created December 25, 2022 21:41
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save vfarcic/38b4b02bef304fc98c519f6dd6074545 to your computer and use it in GitHub Desktop.
Save vfarcic/38b4b02bef304fc98c519f6dd6074545 to your computer and use it in GitHub Desktop.
# 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