This is a simple HTTP server that provides a dice roll service. It's built with TypeScript and uses the Hono server library. It also includes OpenTelemetry instrumentation for metrics and tracing.
These instructions will get you a copy of the project up and running on your local machine for development and testing purposes.
- Node.js (Note: OpenTelemetry currently does not support Bun and Deno)
- npm
- Docker
- Clone the repository
git clone https://github.com/yourusername/dice-roll-service.git
- Navigate into the cloned repository
cd dice-roll-service
- Install the dependencies
npm install
- Start the development server
npm run dev
- Run docker-compose to start Prometheus and Jaeger servers
docker-compose up
Now, the server is running at http://localhost:3000
.
GET /
: Returns a welcome message.GET /roll?rolls=<number>
: Returns the result of rolling a dice the specified number of times.
This project uses OpenTelemetry to collect metrics and traces. It exports metrics to a Prometheus server and traces to a Jaeger server.
You can start a Prometheus and Jaeger server using the provided Docker Compose file. Run docker-compose up
to start the servers.
Prometheus will be available at http://localhost:9090
and Jaeger at http://localhost:16686
.