This directory contains an end-to-end test (test-e2e.sh) that validates the complete OpenTelemetry reference application stack.
The test verifies:
- Application functionality: All endpoints return correct responses
- OpenTelemetry integration: Telemetry data is generated and exported
- Collector functionality: OTLP data is received and processed
- Prometheus integration: Metrics are scraped and available
- Docker Compose setup: All services start and work together
- Docker
- Docker Compose (or
docker compose) - curl
- jq
# Via Gradle
../gradlew e2eTest
# Directly
./test-e2e.sh
# Dry-run (validation only)
./test-e2e.sh --dry-run- Setup: Cleans any existing containers and builds fresh images
- Start services: Runs
docker-compose up --build -d - Wait for readiness: Polls health endpoints until services are ready
- Functional tests: Tests all application endpoints
- Telemetry validation: Verifies OpenTelemetry data collection
- Integration tests: Checks collector and Prometheus functionality
- Cleanup: Stops and removes all containers and volumes
GET /rolldice- Basic dice rollingGET /rolldice?player=testuser- Parameterized requestsGET /rolldice?rolls=3- Multiple dice rollsGET /health- Health check
- Java Agent instrumentation
- Custom span creation
- Metrics generation
- Log correlation
- OTLP export to collector
In addition to end-to-end infrastructure testing, the application includes telemetry testing that validates actual OpenTelemetry data export:
- Trace validation: Verifies spans are created with correct names, attributes, and events
- Metric validation: Confirms custom metrics are exported properly
- Baggage testing: Validates cross-cutting concern propagation
- MockServer integration: Captures OTLP requests for detailed analysis
These tests run with the OpenTelemetry Java Agent and use the same protobuf parsing as the telemetry-testing example.
- OpenTelemetry Collector OTLP ingestion
- Prometheus metrics scraping
- Service networking and dependencies
This test can be integrated into CI/CD pipelines to ensure the reference application works correctly in a production-like environment.
Example GitHub Actions usage:
- name: Run end-to-end test
run: |
cd reference-application
./test-e2e.shThe test automatically handles cleanup and provides clear success/failure indicators.