Ouroboros Metrics: Difference between revisions

From Ouroboros
Jump to navigation Jump to search
Line 27: Line 27:
== Setup InfluxDB and Grafana and get the dashboard ==
== Setup InfluxDB and Grafana and get the dashboard ==


Install and run InfluxDB and create a bucket in InfluxDB for exporting Ouroboros metrics, and an API token for writing to that bucket. Consult the [https://docs.influxdata.com/influxdb/v2.0/get-started/#set-up-influxdb InfluxDB documentation] on how to do this. The default bucket name for the exporter is ''ouroboros-metrics'', but you can choose another name and use the ''--bucket'' option of the exporter.
Install and run InfluxDB and create a bucket in InfluxDB for exporting Ouroboros metrics, and an API token for (reading and) writing to that bucket. Consult the [https://docs.influxdata.com/influxdb/v2.0/get-started/#set-up-influxdb InfluxDB documentation] on how to do this. The default bucket name for the exporter is ''ouroboros-metrics'', but you can choose another name and use the ''--bucket'' option of the exporter.


To use grafana, [https://grafana.com/grafana/download install and run grafana open source].  
To use grafana, [https://grafana.com/grafana/download install and run grafana open source].  


Go to the grafana UI (usually [http://localhost:3000 http://localhost:3000]) and set up InfluxDB as your datasource: Go to Configuration -> Datasources -> Add datasource and select InfluxDB Set “flux” as the Query Language, and under “InfluxDB Details” set your Organization as in InfluxDB and set the copy/paste the token for the bucket to the Token field.
Go to the grafana UI (usually [http://localhost:3000 http://localhost:3000]) and set up InfluxDB as your datasource: Go to Configuration -> Datasources -> Add datasource and select InfluxDB Set “flux” as the Query Language, and under “InfluxDB Details” set your Organization as in InfluxDB and set the copy/paste an API token for reading the bucket to the Token field.


To add the Ouroboros dashboard, select Dashboards -> Manage -> Import
To add the Ouroboros dashboard, select Dashboards -> Manage -> Import

Revision as of 10:57, 25 November 2023

Under contruction This page is under construction  

Ouroboros Dashboard

A collection of observability tools for exporting and visualising metrics collected from Ouroboros.

Currently has one very simple exporter for InfluxDB, and provides additional visualization via grafana.

More features will be added over time.

Requirements

Ouroboros version >= 0.18.3

InfluxDB OSS 2.0

python influxdb-client, install via

pip install 'influxdb-client[ciso]'

And you might also need pytz

pip install pytz

It is highly recommended to install grafana for visualization.

Setup InfluxDB and Grafana and get the dashboard

Install and run InfluxDB and create a bucket in InfluxDB for exporting Ouroboros metrics, and an API token for (reading and) writing to that bucket. Consult the InfluxDB documentation on how to do this. The default bucket name for the exporter is ouroboros-metrics, but you can choose another name and use the --bucket option of the exporter.

To use grafana, install and run grafana open source.

Go to the grafana UI (usually http://localhost:3000) and set up InfluxDB as your datasource: Go to Configuration -> Datasources -> Add datasource and select InfluxDB Set “flux” as the Query Language, and under “InfluxDB Details” set your Organization as in InfluxDB and set the copy/paste an API token for reading the bucket to the Token field.

To add the Ouroboros dashboard, select Dashboards -> Manage -> Import

and then either upload the json file from the metrics repository in

dashboards-grafana/general.json

or copy the contents of that file to the “Import via panel json” textbox and click “Load”.

Step by step instructions

On each of the machines running O7s, install the exporter

git clone https://ouroboros.rocks/git/ouroboros-metrics
cd ouroboros-metrics
cd exporters-influxdb/pyExporter/

It is common to create a virtual environment for Python and install the dependencies

python -m venv ./venv
source venv/bin/activate
pip install --upgrade pip
pip install influxdb_client[ciso] pytz

Edit the config.ini.example file and fill out the InfluxDB information (token, org). This file will be identical on all machines.

[influx2]
url=http://<IP address of machine running InfluxDB>:8086
org=<your-org>
token=<your-token>
timeout=6000
verify_ssl=False

Save it as config.ini.

Now you can run the exporter:

python oexport.py

Options for the exporter can be shown using

python oexport.py --help