This is a prometheus exporter for DBMS "Red Database".
Name | Description |
---|---|
db_size | The amount of database bytes which are taken to store data. |
diff_oldt_nt | The difference between Oldest transaction number and Next transaction number. |
active_users | The amount of active users in a database. |
mon_io_stats | The amount of read, written, fetched, marked pages of a database/connections/transactions/statements/calls. |
mon_memory_usage | Information about memory usage by database/connections/transactions/statements/calls/cached_queries |
mon_database | Information about a database:
|
mon_attachment | Displays information about active attachments to the database:
|
mon_transaction | Reports started transactions:
|
mon_statement | Displays statements prepared for execution:
|
mon_call_stack | Displays calls to the stack from queries executing in stored procedures and triggers:
|
system_memory |
Information about device RAM:
|
system_cpu |
Information about cpu usage:
|
trace_statements |
Shows amount of failed and successful statements:
|
You need to add a configuration json file beside "main.py" file and name it "exporter_conf" and fill it with a content.
The example of required content is:
{
"port": 8000,
"login": "SYSDBA",
"password": "masterkey",
"RDB_port": 3050,
"RedDatabase": "/opt/RedDatabase"
"databases": {
"[db_nickname]": "localhost:[insert_path_to_database]",
"[another_db_nickname]": "localhost:[insert_path_to_another_database]"
},
"trace": "[insert_path_to_fdbtrace_text]"
}
Field "port" is the port which will be using by exporter.
Prometheus can be configured from either a terminal and a configuration file. The most important settings are from which node prometheus scrapes metrics and time between two scrape queries. The example content of prometheus configuration file:
global:
scrape_interval: 10s # Time between two scrape queries
scrape_configs:
- job_name: "RedDatabases"
static_configs:
- targets: ["localhost:8000"] # A node where exporter is located
You need to install next following libraries to make the exporter work:
- psutil version 5.9.4 (pip install psutil==5.9.4)
- firebirdsql version 1.2.2 (pip install firebirdsql==1.2.2)
- Install python, libraries, Prometheus, Grafana, Exporter;
- Launch RedDatabase server;
- Edit exporter configuration file;
- Launch this exporter (python main.py);
- Edit Prometheus configuration file;
- Launch prometheus;
- Launch Grafana (on linux: sudo systemctl start grafana-server). It might be on 3000 port now;
- Open browser and insert into address section the next following string "http://localhost:3000/";
- Enter login and password to sign in. The string "admin" is default login and password. Grafana make you change default password when you have signed in for the first time;
- Make a data source. To do it you must go to left side of screen and find a gear picture (configure section) then click on the "Data sources" subsection. Now click the button "add data source, select Prometheus, insert url path to prometheus (default is "http://localhost:9090/")", click the button "Save & test";
- Import dashboards or build your own. To import dashboards you must find the "Dashboards" section at the left side of the screen and click the "+ Import" button. Click the button "Upload JSON file" and select json file of a dashboard, click "Import". To build your own dashboard follow instructions at Grafana official site.