Skip to content

Latest commit

 

History

History
49 lines (34 loc) · 1.89 KB

README.md

File metadata and controls

49 lines (34 loc) · 1.89 KB

OpenTelemetry Collector Demo

This demo is a sample Python app to build the collector and exercise its tracing functionality. To build and run the demo, we will need to deploy the Python app and the collector and send traces to Azure Monitor.

Deploying the Python Application

1. Create Docker image for Python app

docker build -f Dockerfile.python . -t <name:tag>
docker push <name:tag>

2. Delete previous deployments

kubectl delete -f python-deployment.yaml

3. Check deployment and related pods are deleted

kubectl get deployments
kubectl get pods

4. Deploy

kubectl apply -f python-deployment.yaml

Once that has been completed, it is time to deploy the collector.

Deploying the Collector

1. Create Docker image for collector

docker build -t <name:tag> .
docker push <name:tag>

2. Delete previous deployments

kubectl delete -f omsagent-otel.yaml

3. Check deployment and related pods are deleted

kubectl get deployments kubectl get pods

4. Update & Deploy

Go to omsagent-otel.yaml (in kubernetes folder), and update "image" for the otel-collector deployment to be the docker image you just built. Then, run: kubectl apply -f omsagent-otel.yaml

Finally, it is time to emit traces and see them in Application Insights.

Run Python application and emit traces

1. Execute commands from container

kubectl exec -it <name of pod> /bin/bash

2. Generate spans

Note: if the probability sampler is enabled in the otel-collector, you might not see all the spans you send (adjust this number in collector's configuration, or disable it). curl http://localhost:5001

Now, you should be able to go under the "Investigate" tab in Azure Portal and view your traces in Application Map or in Search. Take into account that it may take up to a few minutes before the traces show up.