A tiny two-service Spring Boot app to generate realistic telemetry (traces, metrics, logs) across multiple communication patterns. It’s meant for demos and testing—not as a production service.
- Build images
./build.sh- Start stack
docker-compose up -d- Drive traffic (gRPC documented last, see Endpoints)
curl -s http://localhost:9980/rest-chain
curl -s http://localhost:9980/kafka-rr
curl -s http://localhost:9980/kafka-ff
curl -s http://localhost:9980/db-ops
curl -s http://localhost:9980/es-ops
curl -s http://localhost:9980/grpc- Verify telemetry locally
tail -f otel-logs/telemetry.log- Stop
docker-compose downThis app only produces telemetry; it doesn’t store or visualize it. A collector ingests the data.
- Protocol: OTLP over HTTP (http/protobuf), not OTLP/gRPC
- Default wiring (Compose):
- Services export to
otel-test-collector:5318(OTLP/HTTP) - The local test collector writes to
otel-logs/telemetry.logand proxies to your host athttp://host.docker.internal:4318 - Change the proxy target in
otel-collector-config.yamlatexporters.otlphttp/production.endpoint
- Services export to
- Ports you’ll see:
- 5318: OTLP HTTP receiver on the local test collector
- 4318: Typical OTLP HTTP endpoint on your external/vendor collector
- 9090: gRPC between gateway and processor (demo endpoint only; not telemetry)
Point telemetry to your own collector/vendor
- Direct: set
OTEL_EXPORTER_OTLP_ENDPOINT=http://<collector-host>:4318and keepOTEL_EXPORTER_OTLP_PROTOCOL=http/protobuf - Via local proxy (default): keep services pointing at
otel-test-collector:5318and changeotel-collector-config.yamlexporter target
Quick checks
- Collector logs:
docker-compose logs otel-test-collector - Local spans:
tail -f otel-logs/telemetry.log
- REST request-response
GET /rest-chain→ Gateway → Processor (REST)
- Kafka request-reply (sync semantics)
GET /kafka-rr→ Gateway ↔ Processor (Kafka RR)
- Kafka fire-and-forget
GET /kafka-ff→ Gateway → Processor (Kafka FF)
- Database operations
GET /db-ops→ Gateway → PostgreSQL (write + read)
- Elasticsearch operations
GET /es-ops→ Gateway → Elasticsearch (index + get)
- gRPC call (documented last)
GET /grpc→ Gateway → Processor (gRPC on 9090)- Note: This gRPC is only for the demo pattern; telemetry export still uses OTLP/HTTP.
- Services
- Gateway service: 9980 (HTTP)
- Processor service: 9981 (HTTP), 9090 (gRPC)
- Infra
- Kafka: 9092 (host), 29092 (in-cluster)
- PostgreSQL: 5432
- Elasticsearch: 9200/9300
- Local OTEL collector: 5318 (OTLP/HTTP)
- External/vendor collector (typical): 4318 (OTLP/HTTP)
- Telemetry not arriving at vendor/collector
- Use HTTP 4318, not gRPC 4317; set
OTEL_EXPORTER_OTLP_PROTOCOL=http/protobuf - If you see errors like “Connection refused … :443”, you likely pointed to an HTTPS-only URL without TLS or to the wrong port
- Use HTTP 4318, not gRPC 4317; set
- gRPC 9090 errors
- That port is only for the demo gRPC endpoint; it’s not used for telemetry export
- Infra health
- Check:
docker-compose psand service logs - Elasticsearch: http://localhost:9200
- Kafka topics are created by the
kafka-topics-initcontainer
- Check: