Table of Contents
Log Ingester and Query Tool built using Django for Dyte SDE Assessment.
- Python
- Django
- PostgreSQL
- SQLite3
- Docker
The project can be run using a local SQLite database, or using Docker. Both methods are described below.
- Python 3.10 or higher
- Docker (optional)
-
Clone the repo
git clone https://github.com/dyte-submissions/november-2023-hiring-Enhancifire.git
-
Create virtual environment
python -m venv .env
-
Activate the environment
source .env/bin/activate.fish # for fish shell
-
Install requirements
pip install -r requirements.txt
-
Run migrations
python manage.py migrate
-
Run the server
python manage.py runserver 3000
-
Clone the repo
git clone https://github.com/dyte-submissions/november-2023-hiring-Enhancifire.git
-
Switch branch to docker
git checkout docker
-
Start DB and build docker image
docker compose up db -d
-
Build and Start the server
docker compose up server --build
-
Run migrations
docker compose exec server python manage.py migrate
-
Access the server at
localhost:3000
Access the server at localhost:3000
Endpoints:
-
'/': Home page Query interface is accessible here
-
'/logs/': Ingest point for logs POST request to add individual logs to the database
-
'/logsearch/': Search endpoint for logs Query interface accesses this endpoint to search for logs
Ingestor:
- Develop a mechanism to ingest logs in the provided format.
- Ensure scalability to handle high volumes of logs efficiently.
- Mitigate potential bottlenecks such as I/O operations, database write speeds, etc.
- Make sure that the logs are ingested via an HTTP server, which runs on port
3000
by default.
Query Interface:
- Offer a user interface (Web UI or CLI) for full-text search across logs.
- Include filters based on:
- level
- message
- resourceId
- timestamp
- traceId
- spanId
- commit
- metadata.parentResourceId
- Aim for efficient and quick search results.
Advanced Features:
- Allow combining multiple filters.
- Provide real-time log ingestion and searching capabilities.
- Distributed systems or cloud-based solutions can ensure robust scalability.
- Implement role-based access to the query interface.
- Implement search within specific date ranges.
- Utilize regular expressions for search.
- Manual migration for Postgres required in docker usecase.
- Possible bottleneck of single threaded django instance.
- Static metadata field parameter. Adding additional data to metadata requires conversion from foreign key to BSON.
Faiz Saiyad - +91 8177941560 - [email protected]
Project Link: https://github.com/dyte-submissions/november-2023-hiring-Enhancifire