Kubernetes Community São Paulo - 2024
Simplificando o Monitoramento de aplicações NodeJS.
kind create cluster -n kcdsp --config kind.yaml
kubectl apply -f tempo.yaml
Build the NodeJS Voting App
docker build -t nodejs-voting-app:kcdsp nodejs-voting-app
Build the NodeJS Voting App
kubectl apply -f nodejs-voting-app/deployment.yaml
kubectl apply -f https://github.com/cert-manager/cert-manager/releases/download/v1.14.2/cert-manager.yaml
Install the OpenTelemetry Operator
kubectl apply -f https://github.com/open-telemetry/opentelemetry-operator/releases/latest/download/opentelemetry-operator.yaml
Deploy the OpenTelemetry Collector
kubectl apply -f otel.yaml
Forward a local port to your application
kubectl port-forward -n kcdsp svc/nodejs-voting-app-service 8080:80
Forward a local port to your Grafana Instance
kubectl port-forward -n kcdsp svc/grafana 3000:3000
Apply the auto-instrumentation manifest
kubectl apply -f instrumentation.yaml
Set the required annotation into your NodeJS app.
kubectl patch deployment nodejs-voting-app -n kcdsp -p '{"spec": {"template":{"metadata":{"annotations":{"instrumentation.opentelemetry.io/inject-nodejs":"true"}}}} }'
Create some traffic to your app.
curl -X POST localhost:8080/vote -H "Content-Type: application/json" -d '{"candidate": "1"}'