DeFiCh / DeFiCh/libain-rs

Sidecar - Node Crash Monitoring, Logging

Open
#4 5 comments 0 reactions 0 assignees View on GitHub
Dominant language
Rust
Stars
3
Forks
0
PR merge metrics
No merged PRs in 30d

Description

Sidecar for monitoring `defid` process and logs analytics
## Overview
Sidecar primary function is to use a debugging tool i.e to make easier to read logs , node events and monitor node process resource usage. It can be extended to profile memory and cpu usage in the future with [BPF](https://en.wikipedia.org/wiki/Berkeley_Packet_Filter) for real-time profiling.

## Implementation Details

This approach uses [syslog](https://docs.docker.com/config/containers/logging/syslog/) protocol which wraps log message into UDP packet and send them through a UDP server. A log server which run on the sidecar will take the packet and process them into a struct and index them in a rockdb storage and into a full search engine, sidecar support for opentelemetry export of logs/events which supported format for AWS cloudtrail for distributed logging.

## Storage
Rockdb is used to make the sidecar as lightweight and customizable as possible, and [tantivy](https://github.com/quickwit-oss/tantivy) is used a full search database.

## API
Log can be looked up and referenced through an api endpoint provided by log server
### Endpoints
### `/logs`
### Query Paramters
| Name | Type | Description |
|----------------|---------|-----------------------------------------------------------------------------------------------------------------------------------------|
| `offset` | integer | offset from the last log message if `direction` is `backward` or the first log message of `direction` is `forward` |
| `limit` | integer | Max logs |
| `log_category` | enum | log level |
| `timestamp` | integer | timestamp |
| `direction` | enum | `forward` `backward` |
| `query` | string | Text search [Query](https://docs.rs/tantivy/latest/tantivy/query/struct.QueryParser.html), all other parameter are disable except limit |

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.