Skip to content

aqsyonas/cloki-go

Repository files navigation

cLoki-go

like Loki, but for Clickhouse.

Super experimental, fully functional Loki API emulator in GO for Clickhouse
APIs are compatible with Grafana Explore and paStash for logs ingestion

🔥 Beta Stage, Contributions Welcome! :octocat: Do not use this for anything serious.. yet!

ezgif com-optimize 15

Project Background

The Loki API and its Grafana native integration are brilliant, simple and appealing - but we just love Clickhouse.

cLoki implements the same API functionality as Loki in GO, sitting on top of Clickhouse tables and relying on its columnar search and insert performance alongside solid distribuion and clustering capabilities for stored data. Just like Loki, cLoki does not parse or index incoming logs, but rather groups log streams using the same label system as Prometheus.

The current purpose of this project is to research and understand inner aspects of the original implementation.

Instructions

Requirements

  • golang 1.13+

Installation

To get dependencies and compile the latest cloki-webapp from source, use the following commands:

make modules
make all

Configuration

Before using the application, configure all database parameters using the example configuration file:

clokiapp_config.json

Usage

Command Help
./cloki-go -h
Custom Config in /etc
./cloki-go -config-path /etc
Initialization

To initialize the database and tables required by the application use the following commands:

./cloki-go --initialize_db
Create User
./cloki-go -create-cloki-user -database-root=default -database-host=localhost -database-root-password=password
Create CLOKI DBs
./cloki-go -create-cloki-db -database-root=default -database-host=localhost -database-root-password=password -database-cloki-user=cloki_user

Create Table / Migration - connection data will be read from webapp_config.json
./cloki-go -create-table-db-config 

Usage ENV

WEBAPPENV = config file extension "local" 
WEBAPPPATH - path for config
WEBAPPLOGPATH - path to the log dir
WEBAPPLOGNAME - prefix name of the log

License & Copyright

This project is released under the Apache License 2.0

Made by Humans

This Open-Source project is made possible by actual Humans without corporate sponsors, angels or patreons.
If you use this software in production, please consider supporting its development with contributions or donations

Donate

(C) 2020 QXIP BV

About

Clickhouse Loki API in GO

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages