Observer is a telemetry data visualization application built using Next.js, OpenTelemetry, and ClickHouse. The application features a service map, service list, and detailed views for specific telemetry data.
This project is structured as a Turborepo application with multiple services and packages. The main components include:
- Dashboard: A Next.js application for visualizing telemetry data.
- Order Service: An Express.js microservice.
- Product Service: An Express.js microservice.
- User Service: An Express.js microservice.
- UI: Shared UI components and styles.
- ESLint Config: Shared ESLint configurations.
- TypeScript Config: Shared TypeScript configurations.
- Infrastack Interview FS MEK 20240830: A wrapper for OpenTelemetry SDKs.
- Node.js >= 18
- Docker
- Docker Compose
- pnpm
-
Clone the repository:
git clone https://github.com/your-username/observer.git cd observer
-
Install dependencies:
pnpm install
-
Set up environment variables:
Create a
.env
file in the root directory and add your ClickHouse credentials:CLICKHOUSE_ENDPOINT=your_endpoint_here CLICKHOUSE_DATABASE=your_database_here CLICKHOUSE_USERNAME=your_username_here CLICKHOUSE_PASSWORD=your_password_here
-
Set up the OpenTelemetry Collector:
cp docker/otel-collector/otel-collector-config.example.yaml docker/otel-collector/otel-collector-config.yaml
-
Start the services:
pnpm start:all
-
Navigate to the
apps/dashboard
directory:cd apps/dashboard
-
Start the development server:
pnpm dev
-
Open http://localhost:3001 in your browser.
-
Navigate to the root directory of the project:
cd ../../
-
Start the services using Docker Compose:
docker-compose up -d
The services will be available at the following URLs:
- Order Service: http://localhost:4002/orders
- Product Service: http://localhost:4003/products
- User Service: http://localhost:4001/users
- apps: Contains the main applications.
- packages: Contains shared packages and configurations.
- docker: Contains Docker-related configurations.
- tools: Contains utility scripts and tools.
The Dashboard application is a Next.js project that provides a user interface for monitoring and managing services.
- Getting Started: Refer to the Dashboard README for setup instructions.
- Development: Run the development server using
pnpm dev
. - Deployment: Follow the Next.js deployment documentation for deployment details.
The Order Service is an Express.js application that handles order-related operations.
- Getting Started: Refer to the Order Service README for setup instructions.
- Development: Run the development server using
pnpm dev
. - Docker: The service can be run using Docker. Refer to the Dockerfile for details.
The Product Service is an Express.js application that handles product-related operations.
- Getting Started: Refer to the Product Service README for setup instructions.
- Development: Run the development server using
pnpm dev
. - Docker: The service can be run using Docker. Refer to the Dockerfile for details.
The User Service is an Express.js application that handles user-related operations.
- Getting Started: Refer to the User Service README for setup instructions.
- Development: Run the development server using
pnpm dev
. - Docker: The service can be run using Docker. Refer to the Dockerfile for details.
The UI package contains shared UI components and styles.
- Getting Started: Refer to the UI README for setup instructions.
- Development: Run the development server using
pnpm dev
.
The ESLint Config package contains shared ESLint configurations.
- Getting Started: Refer to the ESLint Config README for setup instructions.
The TypeScript Config package contains shared TypeScript configurations.
- Getting Started: Refer to the TypeScript Config README for setup instructions.
The Infrastack Interview FS MEK 20240830 package is a wrapper for the OpenTelemetry SDK.
- Getting Started: Refer to the Infrastack Interview FS MEK 20240830 README for setup instructions.
The OpenTelemetry Collector is configured to collect and export telemetry data.
- Configuration: The collector example configuration can be found in the otel-collector-config.yaml file.
The tools directory contains utility scripts and tools for the project.
- Validation Scripts: Contains scripts for data validation and other utilities. Refer to the Tools README for setup instructions and details.