Example of using OpenTelemetry tracing through Ginkgo tests
-
Start a Jaeger all-in-one instance:
docker run \ --interactive \ --name jaeger \ --rm \ --tty \ --env COLLECTOR_OTLP_ENABLED=true \ --publish 0.0.0.0:16686:16686 \ --publish 0.0.0.0:4317:4317 \ --publish 0.0.0.0:44317:44317 \ jaegertracing/all-in-one:1.35
-
Start an open-telemetry-collector instance:
docker run \ --interactive \ --network container:jaeger \ --rm \ --tty \ --volume "$PWD/open-telemetry-config.yaml:/open-telemetry-config.yaml" \ otel/opentelemetry-collector-contrib:0.104.0 --config /open-telemetry-config.yaml -
Start microservice-a:
go run ./cmd/microservice-a
-
Start microservice-b:
go run ./cmd/microservice-b
-
Install Ginkgo:
go install -mod=mod github.com/onsi/ginkgo/v2/ginkgo
-
Run Ginkgo tests:
ginkgo run -v ./test/...