Hastic standalone

Overview

Hastic

Hastic needs Prometheus or InfluxDB instance for getting metrics.

Build from source (Linux)

Prerequirements

  1. Install cargo
  2. Install x86_64-unknown-linux-musl: rustup target add x86_64-unknown-linux-musl
  3. musl-tools: sudo apt install musl-tools

Build

make
cd release
./hastic

open http://localhost:4347 in browser

Comments
  • backet \ detection window for pattern analytic unit

    backet \ detection window for pattern analytic unit

    Only threshold can work without "window": it takes one datapoint from metric and checks if it falls over threshold. In case of pattern and anomaly detector it's impossible to make detection on one datapoint, so we need to define the size of the window which could be used for pattern / anomaly detection. Supposedly, we need to

    1. implement method get_detection_window from AnalyticUnit trait.
    2. fill bucket in DetectionRunner::run with of size get_detection_window
    3. run detection on bucket
    opened by glitch4347 4
  • Analytic is stuck at Learning

    Analytic is stuck at Learning

    I've changed the Seasonality value from 7220 to 722 and now I can't do anything, analytics always showing the Learning status

    Maybe we can display logs somewhere so that a user have better understanding of what's going on

    image

    opened by rozetko 2
  • UI: not editable confidence param

    UI: not editable confidence param

    for a reason I can't edit confidence param in anomaly unit.

    Steps to reproduce:

    • Choose anomaly detector
    • try to change confidence param from 10 to something else

    Behavior:

    • confidence tot changed
    bug 
    opened by glitch4347 1
  • env variables configuration #55

    env variables configuration #55

    Closes #55

    This PR makes it possible to configure hastic using environment variables

    Changes:

    • remove config::Environment::with_prefix("HASTIC") usage because it doesn't support nested keys, e.g. alerting.type
    • use update_from_env instead (a function copied from here: https://github.com/rust-lang/mdBook/blob/f3e5fce6bf5e290c713f4015947dc0f0ad172d20/src/config.rs#L132), it replaces __ in the variables with .

    Configuration example:

    HASTIC_PORT=8000 \
    HASTIC_PROMETHEUS__URL="http://localhost:9090" \
    HASTIC_PROMETHEUS__URL="rate(go_memstats_alloc_bytes_total[5m])" \
    cargo run
    

    TODO: we also need to add configuration docs to the readme, I'll do it in a separate PR

    opened by rozetko 1
  • active analytic unit

    active analytic unit

    • [ ] refactor methods resolve and resolve_au in analytic_unit_service to work with db
    • [x] field in db
    • [x] take active analytic unit from db by id
    • [x] case of default active analytic unit (fresh start of the server)
    • [x] set active analytic unit in db
    • [x] config patch vs db
    opened by glitch4347 1
  • detection runner detection notification

    detection runner detection notification

    Closes https://github.com/hastic/hastic/issues/51

    Changes

    • New DetectionRunnerDetection type and it's usad ein AnalyticUnitSerive and DetectionRunner
    opened by glitch4347 0
  • data folder creation single place

    data folder creation single place

    Closes https://github.com/hastic/hastic/issues/102

    Changes

    • New DataService module which contains analytic_units_connection and segments_connection
    • SegmentService and AnalyticUnitsService now take ds: &DataService param
    opened by glitch4347 0
  •  UI: not editable confidence param

    UI: not editable confidence param

    closes https://github.com/hastic/hastic/issues/99

    Changes

    • use v-model instead of :value -- don't really know why it works, but docs are here: https://v3.vuejs.org/guide/migration/v-model.html#using-v-bind-sync
    opened by glitch4347 0
  • Show error if server is down #48

    Show error if server is down #48

    Closes #48

    image

    Changes:

    • change AnalyticStatus type: store availability and message instead of just message
    • handle GET /status errors
    • display error message if server is down
    • do not display anything below the Analytic Status if server is down

    TODO:

    • remove the empty space (where the chart should be) if server is down
    • #92

    Other changes:

    • change default port: 8000 -> 4347
    opened by rozetko 0
  • Bucket detection window for pattern analytic unit #83

    Bucket detection window for pattern analytic unit #83

    Closes https://github.com/hastic/hastic/issues/83

    Changes

    • MetricService now has get_detection_step method which return 10 -- it's a hack
    • PatternAnalyticUnit returns avg_pattern_length in get_detection_window -- it's also not 100% right cuz there used unwrap and formally learning results can be None

    Notes

    This PR doesn't really introduce bucket and query from metrics_service used to get data for detection

    opened by glitch4347 0
  • Analytic unit type and meta in db #65

    Analytic unit type and meta in db #65

    Closes https://github.com/hastic/hastic/issues/65

    Changes

    • ramade from scratch AnlyticSerivice::patch_config: now it extracts data from db instead of Default
    • new method AnalyticUnitConfig::patch_needs_learning which replaces a bit logic of AnalyticUnitConfig::patch. AnalyticUnitConfig::patch is maybe deprecated now
    • new methods in PatchConfig and AnalyticUnitService for resolving / setting configs by it -- it's still hack where id and type_id correspond to each other

    Other

    • code format

    Notes

    • the code is really ugly it this point and logic of id's vs PatchConfig should be rethought
    • logic of need_learning overlaps with logic of same_type in AnalyticService::patch_config
    • it's not that update db work in blocking way
    opened by glitch4347 0
  • Hastic standalone docker and influx, analytic status: Network Error

    Hastic standalone docker and influx, analytic status: Network Error

    Hello, i was trying to play a bit with this tool but i get the following

    image

    Description: The error above was given by Adblock extension but in any case i cant "connect" the influx database to hastic (see below)

    Setup: Influxdb and grafana are on the same docker-compose file of hastic and both are under authentication. Influxdb and grafana are running ok and i can plot all my data. Sensors are posting to influx with the same token i'm using for hastic

    Regards,

    opened by maxdd 10
  • Too many detection in anomaly unit detection runner

    Too many detection in anomaly unit detection runner

    When detection runner starts with anomaly unit, it detects too many segments. For example, if I started DetectionRunner::run(1641685784), then the line let detections = a.detect(ms.clone(), t_from, t_to).await.unwrap(); works with t_from = 1641721134, but the first detection in detections is (1641685784, 1641685924), the second is (1641685934, 1641685984) and there are375in thedetections`

    bug 
    opened by glitch4347 0
  •  tcp connect error to datasource

    tcp connect error to datasource

    the error I've got:

    thread 'tokio-runtime-worker' panicked at 'called `Result::unwrap()` on an `Err` value: error trying to connect: tcp connect error: Connection timed out (os error 110)
    
    Caused by:
        0: tcp connect error: Connection timed out (os error 110)
        1: Connection timed out (os error 110)', src/services/analytic_service/analytic_unit/pattern_analytic_unit.rs:365:59
    note: run with `RUST_BACKTRACE=1` environment variable to display a backtrac
    

    I am connecting to remote prometheus instance. We should handle this case better without panic

    opened by glitch4347 0
  • print config vars to console

    print config vars to console

    There is a comment in the code

    impl Config {
        pub fn new() -> anyhow::Result<Config> {
            let mut config = config::Config::default();
    
            if std::path::Path::new("config.toml").exists() {
                config.merge(config::File::with_name("config")).unwrap();
            }
    
            update_from_env(&mut config);
    
            if config.get::<u16>("port").is_err() {
                config.set("port", 4347).unwrap();
            }
    
            // TODO: print resulted config (perfectly, it needs adding `derive(Debug)` in `subbeat`'s `DatasourceConfig`)
            Ok(Config {
                port: config.get::<u16>("port").unwrap(),
                datasource_config: resolve_datasource(&config)?,
                alerting: resolve_alerting(&config)?,
            })
        }
    }
    

    so this issue is about printing to log (console) variables values

    good first issue 
    opened by glitch4347 0
A standalone libp2p rendezvous server binary.

Standalone Rendezvous Server A standalone libp2p rendezvous server binary. Usage Run the rendezvous_server: rendezvous_server --secret-file <PATH-TO-S

COMIT 15 Jul 20, 2022
rustBoot is a standalone bootloader, written entirely in Rust

rustBoot is a standalone bootloader, written entirely in Rust, designed to run on anything from a microcontroller to a system on chip. It can be used to boot into bare-metal firmware or Linux.

null 78 Dec 28, 2022
Hotham is a framework for quickly and easily creating amazing standalone VR experiences.

?? Under construction! Please mind the mess! ?? Introduction G'day, and welcome to Hotham! ?? Hotham is an attempt to create a lightweight, high perfo

Let Eyes Equals Two 296 Dec 29, 2022
A standalone Forth interpreter/compiler for WebAssembly.

ForSM A standalone Forth interpreter/compiler for WebAssembly. Bootstrapped from a Rust program, but the ultimate goal for it is to be self-hosting. A

Simon Gellis 5 Jun 15, 2022
Wasmtime - Standalone JIT-style runtime for WebAssembly, using Cranelift

wasmtime A standalone runtime for WebAssembly A Bytecode Alliance project Guide | Contributing | Website | Chat Installation The Wasmtime CLI can be i

Bytecode Alliance 11.1k Jan 2, 2023
tectonicdb is a fast, highly compressed standalone database and streaming protocol for order book ticks.

tectonicdb crate docs.rs crate.io tectonicdb tdb-core tdb-server-core tdb-cli tectonicdb is a fast, highly compressed standalone database and streamin

Ricky Han 525 Dec 23, 2022
A video player for your terminal that generates a standalone executable that plays your video.

Szmelc Player Szmelc Player is a program that converts any video you give it to a standalone executable that plays the video in the terminal. It uses

null 1 Jan 9, 2022
Standalone JIT-style runtime for WebAssembly, using Cranelift

wasmtime A standalone runtime for WebAssembly A Bytecode Alliance project Guide | Contributing | Website | Chat Installation The Wasmtime CLI can be i

Bytecode Alliance 11.1k Dec 31, 2022
A standalone Aleo prover build upon snarkOS and snarkVM, with multi-threading optimization

Aleo Light Prover Introduction A standalone Aleo prover build upon snarkOS and snarkVM, with multi-threading optimization. It's called "light" because

Haruka Ma 91 Dec 29, 2022
A standalone, `#![no_std]`-friendly `Logger` crate.

A standalone, #![no_std]-friendly Logger crate. Based on the design of the logger built into the bootloader crate and meant to be used in OS kernels.

Kenny Strawn 1 Feb 6, 2022
A standalone Command Line Interface debugging tool for The Witcher 3 written in Rust

A standalone Command Line Interface debugging tool for The Witcher 3 written in Rust. This tool is intended for Witcher 3 modders who make mainly scri

Przemysław Cedro 5 Apr 20, 2022
A new shellcode injection technique. Given as C++ header, standalone Rust program or library.

FunctionStomping Description This is a brand-new technique for shellcode injection to evade AVs and EDRs. This technique is inspired by Module Stompin

Ido Veltzman 608 Jan 4, 2023
SubZero - a standalone web server that turns your database directly into a REST/GraphQL api

What is this? This is a demo repository for the new subzero codebase implemented in Rust. subZero is a standalone web server that turns your database

subZero 82 Jan 1, 2023
Standalone python3.dll import library generator

Standalone python3.dll import library generator Generates import libraries for the Stable ABI Python DLL for MinGW-w64 and MSVC (cross-)compile target

PyO3 7 Oct 9, 2022
Standalone Northstar RCON client.

Northstar RCON Client This is a small, cross-platform implementation of an RCON client for the Northstar mod, as it's implemented in the RCON PR. Ther

Tom Barham 3 Aug 15, 2022
A standalone code editor with syntax highlighting and themes.

CodeEditor A standalone code (and text) editor for people like me who write their own user interfaces utilizing crates like pixels. CodeEditor renders

Markus Moenig 8 Nov 25, 2022
📦 Distribute Roblox games as standalone executables -- No existing client necessary. 🚧

?? Packer Distribute Roblox games as standalone executables. ?? Packer is still being worked on. Among many other things, Windows is not currently sup

Brooke Rhodes 16 Dec 20, 2022
A standalone Luau script runner 🌙

Lune ?? A standalone Luau script runner ?? Use the ergonomics and readability of Luau for your shell scripts ?? ⚙️ Installation The preferred way of i

Filip Tibell 13 Feb 2, 2023
Wrap a standalone FFmpeg binary in an intuitive Iterator interface. 🏍

FFmpeg Sidecar ?? Wrap a standalone FFmpeg binary in an intuitive Iterator interface. Motivation The core goal of this project is to provide a method

Nathan Babcock 26 Feb 22, 2023
Rust library provides a standalone implementation of the ROS (Robot Operating System) core

ROS-core implementation in Rust This Rust library provides a standalone implementation of the ROS (Robot Operating System) core. It allows you to run

Patrick Wieschollek 3 Apr 26, 2023