This guide demonstrates how to run Node.js and Python sample applications on Kubernetes (via Docker Desktop) with Splunk OpenTelemetry instrumentation.
- Docker Desktop with Kubernetes enabled
kubectl
CLI installed and configured- Splunk Observability Cloud account with:
- Access Token (
SPLUNK_ACCESS_TOKEN
) - HEC Token (
SPLUNK_HEC_TOKEN
)
- Access Token (
- Open Docker Desktop.
- Go to Settings → Kubernetes.
- Enable Kubernetes and wait until it's running.
Edit splunk-otel-deploy.yaml
and update the following environment variables:
env:
- name: SPLUNK_ACCESS_TOKEN
value: "<ADD-YOURS>"
- name: SPLUNK_REALM
value: "eu0"
- name: SPLUNK_METRICS_ENABLED
value: "true"
- name: SPLUNK_TRACE_ENABLED
value: "true"
- name: SPLUNK_LOGS_ENABLED
value: "false"
- name: SPLUNK_HEC_TOKEN
value: "<ADD-YOURS>"
Apply the configuration:
kubectl apply -f splunk-otel-deploy.yaml
# Build Node.js app image
cd nodejs-app
docker build -t apmtest-nodejs:latest .
cd ../
# Build Python app image
cd python-app
docker build -t apmtest-python:latest .
cd ../
# Deploy Node.js app
kubectl apply -f apmtest-nodejs-deploy.yaml
# Deploy Python app
kubectl apply -f apmtest-python-deploy.yaml
- Node.js App: http://localhost:8000/
- Python App: http://localhost:8001/
- Do some test calls:
for i in {1..10000}; do curl http://localhost:8000/; curl http://localhost:8001/; sleep 1; done
Check if all pods are running:
kubectl get pods
Logs can be viewed with:
kubectl logs <pod-name>
If traces are sent OK, you should find
apmtest-nodejs & apmtest-python
in
https://dev.signalfx.com/#/apm
filtering by Environment Dev