This project demonstrates a microservices architecture using Kong as an API gateway, OpenTelemetry for distributed tracing, and Honeycomb.io for observability. It consists of multiple services orchestrated with Docker Compose.
- Kong: API Gateway
- OpenTelemetry Collector: Collects and exports tracing data
- Service1: A sample microservice
- Service2: Another sample microservice
- Client: A service that continuously calls Service1 and Service2 through Kong
- Docker and Docker Compose
- A Honeycomb.io account and API key
-
Clone this repository:
git clone <repository-url> cd <repository-directory>
-
Create a
.env
file in the root directory with your Honeycomb.io credentials:HONEYCOMB_API_KEY=your_api_key_here HONEYCOMB_DATASET=your_dataset_name
-
Create the external Docker network:
docker network create kong-net
-
Start the OpenTelemetry Collector:
docker-compose -f docker-compose-collector.yml up -d
-
Start the main application:
docker-compose up --build
-
The client service will automatically start making requests to Service1 and Service2 through Kong.
.
├── docker-compose.yml
├── docker-compose-collector.yml
├── kong
│ └── kong.yml
├── otel-collector
│ └── otel-collector-config.yml
├── service1
│ ├── Dockerfile
│ ├── requirements.txt
│ └── app.py
├── service2
│ ├── Dockerfile
│ ├── requirements.txt
│ └── app.py
└── client
├── Dockerfile
├── requirements.txt
└── app.py
Once the application is running, you can view the traces in your Honeycomb.io dashboard.
- If services fail to start, check the logs:
docker-compose logs <service-name>
- Ensure all required ports are free on your host machine.
- Verify that the
kong-net
network exists and all services are connected to it.
To add new services:
- Create a new directory for your service.
- Add the service to the
docker-compose.yml
file. - Update Kong configuration in
kong/kong.yml
to route traffic to your new service.
Contributions are welcome! Please feel free to submit a Pull Request.
This project is licensed under the MIT License.