Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/ivanproskuryakov/gaia-metrics
Cosmos - Prometheus metrics collection toolset
https://github.com/ivanproskuryakov/gaia-metrics
ansible cosmos-sdk golang nodejs prometheus
Last synced: 26 days ago
JSON representation
Cosmos - Prometheus metrics collection toolset
- Host: GitHub
- URL: https://github.com/ivanproskuryakov/gaia-metrics
- Owner: ivanproskuryakov
- License: mit
- Created: 2022-12-15T18:30:38.000Z (almost 2 years ago)
- Default Branch: master
- Last Pushed: 2022-12-25T11:00:55.000Z (almost 2 years ago)
- Last Synced: 2024-04-16T07:09:06.198Z (7 months ago)
- Topics: ansible, cosmos-sdk, golang, nodejs, prometheus
- Language: Go
- Homepage:
- Size: 16.2 MB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: readme.md
- License: license.md
Awesome Lists containing this project
README
### Description
The repository is the set of tools to collect cosmos node networking performance.
The metrics collection repository contains three key directories: prometheus, gaia, and metrics.The metrics are being collected each 5s triggered by Prometheus that queries middle layer app written in go and running on `http://127.0.0.1:3000` and underneath operates with a cosmos node running on `http://127.0.0.1:26657`.
```Gaia Node(API) <- Go App <- Prometheus```
The application uses only two endpoints: `http://localhost:26657/status`, `http://localhost:26657/net_info` with three properties collected: `n_peers, latest_block_time, latest_block_height` which can be easilly tuned.
Full specifications of Cosmos API can be found by the link https://docs.tendermint.com/v0.34/rpc/#/.
### Cosmos Installation Manual
Installation of the cosmos network even on a testnet might be tricky, gaia has undergone multiple updates with a variety of testnets running. The documentation might also be not always correct having wrong or pointing to outdated properties, or readme files.I encourage you to read the official documentation https://hub.cosmos.network/main/hub-tutorials/join-testnet.html which will require values for properties `trust_height`, `trust_hash`, `rpc_servers`, `seeds` to be assigned, which you may find this repo.
Testnet explorer: https://explorer.theta-testnet.polypore.xyz/
Testent id: theta-testnet-001The installation itself.
#### 1. Install and build node with network genesis file downloaded
```
git clone https://github.com/cosmos/testnets/tree/master/public
git checkout v7.0.0make install
gaiad init CUSTOM_MONIKER --chain-id theta-testnet-001wget https://github.com/cosmos/testnets/raw/master/public/genesis.json.gz
gunzip genesis.json.gz
cp genesis.json $HOME/.gaia/config/genesis.jsongaiad config chain-id theta-testnet-001
```#### 2. Edit network settings
See https://hub.cosmos.network/main/hub-tutorials/join-testnet.html
Or just copy the config files from this repo to Gaia home dir `$HOME/.gaia/config`.
```
cp gaia/app.toml $HOME/.gaia/config
cp gaia/client.toml $HOME/.gaia/config
cp gaia/config.toml $HOME/.gaia/config
```#### 3. Launch gaia network
```
gaiad start --x-crisis-skip-assert-invariants
```### Metrics Go Installation
Clone this repository, if was not already clonned - `git clone https://github.com/ivanproskuryakov/gaia-metrics`
If required, install golang - https://go.dev/doc/install```
cd mertics/go
go build app.go
./app
```
![metrics running](img/metrics_go.png)### Metrics Go Daemon
```
nano /etc/systemd/system/gaiametrics.servicesudo systemctl daemon-reload
sudo systemctl start gaiametrics.service
sudo systemctl enable gaiametrics.service
```See metrics running:
```
journalctl -fu gaiametrics.service
journalctl -u gaiametrics.service -f
```### Prometheus Installation
Installation of prometheus is pretty straightforward, see https://prometheus.io/download/.
Prometheus operates based on configs, which need to be tuned or replaced with the config from this repo, see `prometheus/prometeus.yml`### Prometheus Daemon
```
nano /etc/systemd/system/prometheus.servicesudo systemctl daemon-reload
sudo systemctl start prometheus.service
sudo systemctl enable prometheus.service
```
![prometeus desync](img/prometheus_desync.png)### Metrics Node Application
The repository contains metrics application wrriten with node.js and TypeScript, see `metrics/node` directory
```
npm run dev
npm run build
http://127.0.0.1:3000/
```### Cosmos Installation Ansible
Installation of cosmos with ansible.
```
https://github.com/hyphacoop/cosmos-ansible
```