mirror of
https://github.com/stefanprodan/podinfo.git
synced 2026-02-14 10:19:52 +00:00
Create a new otel directory; Add a readme and makefile
This commit is contained in:
20
otel/Makefile
Normal file
20
otel/Makefile
Normal file
@@ -0,0 +1,20 @@
|
|||||||
|
DC=docker-compose -f docker-compose.yaml
|
||||||
|
|
||||||
|
.PHONY: help
|
||||||
|
.DEFAULT_GOAL := help
|
||||||
|
|
||||||
|
help:
|
||||||
|
@grep -E '^[a-zA-Z_-]+:.*?## .*$$' $(MAKEFILE_LIST) | sort | awk 'BEGIN {FS = ":.*?## "}; {printf "\033[36m%-30s\033[0m %s\n", $$1, $$2}'
|
||||||
|
|
||||||
|
stop: ## Stop all Docker Containers run in Compose
|
||||||
|
$(DC) stop
|
||||||
|
|
||||||
|
clean: stop ## Clean all Docker Containers and Volumes
|
||||||
|
$(DC) down --rmi local --remove-orphans -v
|
||||||
|
$(DC) rm -f -v
|
||||||
|
|
||||||
|
build: clean ## Rebuild the Docker Image for use by Compose
|
||||||
|
$(DC) build
|
||||||
|
|
||||||
|
run: stop ## Run the Application
|
||||||
|
$(DC) up
|
||||||
37
otel/README.md
Normal file
37
otel/README.md
Normal file
@@ -0,0 +1,37 @@
|
|||||||
|
# Tracing Demo
|
||||||
|
|
||||||
|
The directory contains sample [OpenTelemetry Collector](https://github.com/open-telemetry/opentelemetry-collector)
|
||||||
|
and [Jaeger](https://www.jaegertracing.io) configurations for a tracing demo.
|
||||||
|
|
||||||
|
## Configuration
|
||||||
|
|
||||||
|
The provided [docker-compose.yaml](docker-compose.yaml) sets up 4 Containers
|
||||||
|
|
||||||
|
1. PodInfo Frontend on port 9898
|
||||||
|
2. PodInfo Backend on port 9899
|
||||||
|
3. OpenTelemetry Collector listening on port 4317 for GRPC
|
||||||
|
4. Jaeger all-in-one listening on multiple ports
|
||||||
|
|
||||||
|
## How does it work?
|
||||||
|
|
||||||
|
The frontend pods are configured to call onto the backend pods. Both the podinfo
|
||||||
|
pods are configured to send traces over to the collector at port 4317 using GRPC.
|
||||||
|
The collector forwards all received spans to Jaeger over port 14250 and Jaeger
|
||||||
|
exposes a UI over port `16686`.
|
||||||
|
|
||||||
|
## Running it locally
|
||||||
|
|
||||||
|
1. Start all the Containers
|
||||||
|
```shell
|
||||||
|
make run
|
||||||
|
```
|
||||||
|
2. Send some sample requests
|
||||||
|
```shell
|
||||||
|
curl -v http://localhost:9898/status/200
|
||||||
|
curl -X POST -v http://localhost:9898/api/echo
|
||||||
|
```
|
||||||
|
3. Visit `http://localhost:16686/` to see the spans
|
||||||
|
4. Stop all the containers
|
||||||
|
```shell
|
||||||
|
make stop
|
||||||
|
```
|
||||||
@@ -2,14 +2,14 @@ version: '2'
|
|||||||
|
|
||||||
services:
|
services:
|
||||||
podinfo_frontend:
|
podinfo_frontend:
|
||||||
build: .
|
build: ..
|
||||||
command: ./podinfo --backend-url http://podinfo_backend:9899/status/200 --otel-service-name=podinfo_frontend
|
command: ./podinfo --backend-url http://podinfo_backend:9899/status/200 --otel-service-name=podinfo_frontend
|
||||||
environment:
|
environment:
|
||||||
- OTEL_EXPORTER_OTLP_TRACES_ENDPOINT=http://otel:4317
|
- OTEL_EXPORTER_OTLP_TRACES_ENDPOINT=http://otel:4317
|
||||||
ports:
|
ports:
|
||||||
- "9898:9898"
|
- "9898:9898"
|
||||||
podinfo_backend:
|
podinfo_backend:
|
||||||
build: .
|
build: ..
|
||||||
command: ./podinfo --port 9899 --otel-service-name=podinfo_backend
|
command: ./podinfo --port 9899 --otel-service-name=podinfo_backend
|
||||||
environment:
|
environment:
|
||||||
- OTEL_EXPORTER_OTLP_TRACES_ENDPOINT=http://otel:4317
|
- OTEL_EXPORTER_OTLP_TRACES_ENDPOINT=http://otel:4317
|
||||||
Reference in New Issue
Block a user