# 📦 Tiny Observability

# ** War of Giants **

There are quite a few amazing benchmarks out there where popular observability giants fight each other with [more and less probable cloud scenarios](https://victoriametrics.com/blog/mimir-benchmark/) scaling with 7,000 CPU cores and 30 TiB of RAM. _Don't try to imagine the costs involved - AWS might charge a penny for your thoughts!_  💵

### What about tiny setups?

Most observability systems are ultimately designed for the cloud - _their own, usually_ - and while excelling at war games, they often neglect the _low-fi hackers_ trying to run everything on their arm cardboard servers for fun and to push the low end limits. 

Our platform targets both _mega and micro_ deployments, through the lightweight qryn JS version designed to run anywhere, including low power resources 🚀

We test on Deta Micros, Glitch Projects, Dynos, Edge workers... _and Raspberries!_

<img src="https://j6z7x9q7.rocketcdn.me/wp-content/uploads/2019/09/Heatsink-case-goud-1.jpg" width=150 />

Let's Install the complete **qryn** stack on **aarch64** platforms

### Requirements
- RaspberryPi 4 or clone (aarch64)
- ARMv8 64-Bit OS (DietPI or Raspbian)

### Stack Components
- **qryn-js**
- nodejs 16.x
- clickhouse 22.x arm64
- grafana 9.x 

### Install Procedure
#### Install ClickHouse (aarch64)
Install ClickHouse and define the default user `password`
```
curl -O 'https://builds.clickhouse.com/master/aarch64/clickhouse' && chmod a+x ./clickhouse
./clickhouse install
```

Start the ClickHouse service:
```
sudo clickhouse start
```

#### Install NodeJS  (aarch64)
Install **nodejs 16** using the official installation script
```
curl -sSL https://deb.nodesource.com/setup_16.x | sudo bash -
sudo apt install -y nodejs
```

#### Install qryn
Install **qryn** using the chosen ClickHouse `password`
```
npm install -g qryn @pastash/pastash @pastash/output_loki
```
```
CLICKHOUSE_AUTH="default:password" \ 
CLICKHOUSE_SERVER="localhost" \
CLICKHOUSE_DB="qryn" \
pm2 start qryn --name "qryn"
```

#### Install Grafana  (aarch64)
We're now ready to install **Grafana** using the `arm64` builds

```
wget https://dl.grafana.com/oss/release/grafana_9.1.6_arm64.deb
sudo dpkg -i grafana_9.1.6_arm64.deb
```

#### Configure Grafana
Configure Grafana to use qryn as the datasource for `Loki`, `Prometheus` and `Tempo`

Since everything is local, we'll use `localhost:3100` as the target for all of them

![image](https://user-images.githubusercontent.com/1423657/186918652-d37c11de-a7a8-4d2c-a104-4a63c2da51e5.png)

For more details, please refer to our full [provisioning example]([https://github.com/metrico/qryn-oss-demo/blob/main/grafana/provisioning/datasources/datasource.yml](https://gist.githubusercontent.com/lmangani/a4be2275731783b37e0fd6f67439e5d5/raw/5a4d193976142c729197ae175e59bb927820a58f/datasource.yml))

> That's it! You are ready to start **qryn** 🎉

### TLDR
That's alright! The above procedure is available as a [shell script](https://gist.githubusercontent.com/lmangani/a4be2275731783b37e0fd6f67439e5d5/raw/5a4d193976142c729197ae175e59bb927820a58f/rpi4_cloki_install.sh)



## Next Steps

It's now time for [ingesting](https://qryn.metrico.in/#/ingestion) and [querying](https://qryn.metrico.in/#/getting-started) your logs, metrics and traces using our general documentation and examples. 

_Have fun and feel free to share your experience with our [community](https://metrico.in)!_

![image](https://user-images.githubusercontent.com/1423657/184538094-13c11500-24ef-4468-9f33-dc9d564238e3.gif)

