Refer to the How to activate preconfigured alerts to learn how to do so.
How to monitor your Database Instance with Scaleway Cockpit
You can view your Managed Database for PostgreSQL or MySQL metrics and logs using Scaleway Cockpit. Managed Databases are fully integrated into Cockpit.
Monitoring is available for:
- Primary Database Instance nodes
- Secondary nodes (if High Availability is activated)
- Any Read Replicas
This page explains how to get started with Scaleway Cockpit for viewing your Managed Database metrics and logs.
Before you start
To complete the actions presented below, you must have:
- A Scaleway account logged into the console
- Owner status or IAM permissions allowing you to perform actions in the intended Organization
- A PostgreSQL or MySQL Database Instance
How to activate your Cockpit
Scaleway Cockpit is activated by default if you have created any Scaleway resources integrated with Cockpit.
How to access the Grafana dashboard
To view your Managed Database’s metrics and logs, use the Grafana dashboard which is accessible from the Scaleway console:
- First, you must create a user and their associated credentials (a username and password) for Grafana
- Then, you can use these credentials to access the Grafana dashboard for all your Scaleway products, via the Scaleway console.
-
Create a Grafana user and retrieve their username and password by following this procedure.
-
From the Scaleway console Cockpit overview page, click Open dashboards in the top right corner.
-
Enter your Grafana username and password to log in.
You are directed to the Scaleway Cockpit dashboards homepage.
How to view and understand your Managed Database metrics
-
Click Open dashboards on the top right from the Scaleway Cockpit dashboards homepage.
-
Click either RDB MySQL Overview or RDB PostgreSQL Overview, depending on your engine of choice, on the left side menu.
You are directed to the RDB Overview dashboard.
Metrics are refreshed every minute, and report on the following data:
- CPU usage
- Memory usage
- Total connections
- Disk usage (in % and in Bytes)
- Replication lag in seconds (when High Availability mode is activated or when Read Replicas are created).
Choosing metric parameters
At the top of the dashboard, you can configure the following parameters, that control which metrics are displayed:
- Resource name - Select a specific Database Instance to monitor.
- Node - Choose a specific node (main, replica, or Read Replica). In a High Availability (HA) cluster, both nodes might switch from main to replica and vice versa. So you might see two versions of the same node, as main and as replica. If you select main for a specific node, you will only see the node’s activity when it was the main, and vice-versa.
- Timeframe - Get metrics from the last five minutes up to 31 days (free plan) and 365 days (premium plan).
Viewing logs
The log section is displayed below the metrics section.
Click Logs to collapse the tab and view your logs.
Log configuration is done by Scaleway. Note that:
- The
log_error_verbosity
parameter is set toVERBOSE
for PostgreSQL and2
for MySQL by default. - On PostgreSQL, all queries longer than 5 seconds are logged. This parameter cannot be edited.
- On MySQL, slow queries are not activated by default, but can be activated in the advanced settings of the Database Instance. The setting is called
slow_query_log
and the time can be edited withlong_query_time
.
How to activate preconfigured alerts
You can activate Scaleway preconfigured alerts for your Managed Databases with Scaleway Cockpit.
By default, three preconfigured alerts are available for Managed Databases:
MySQLHighStorageUsage
orPostgreSQLHighStorageUsage
- You are alerted if disk usage is higher than 80% for 10 consecutive minutes.MySQLHighCPULoad
orPostgreSQLHighCPULoad
- You are alerted if CPU usage is higher than 80% for 10 consecutive minutes.MySQLTooManyConnections
orPostgreSQLTooManyConnections
- You are alerted if your connection usage is higher than 80% for 10 consecutive minutes.
You can also configure your own alerts and set values for each of the parameters below to define when you want to be alerted:
MySQL
Alert | Description |
---|---|
rdb_instance_mysql_mysql_global_status_threads_connected | Total active connections on MySQL |
rdb_instance_mysql_mysql_global_variables_max_connections | Maximum number of connections configured |
rdb_instance_mysql_mysql_slave_status_seconds_behind_master | Replica lag in seconds |
rdb_instance_mysql_node_cpu_seconds_total | Total amount of CPU time consumed by the Database Instance, measured in seconds |
rdb_instance_mysql_node_filesystem_avail_bytes | Total amount of remaining available space, in bytes |
rdb_instance_mysql_node_filesystem_size_bytes | Total size of the file system, in bytes |
b_instance_mysql_node_memory_MemAvailable_bytes | Amount of memory available |
rdb_instance_mysql_node_memory_MemTotal_bytes | Total installed physical memory (RAM) |
PostgreSQL
Alert | Description |
---|---|
rdb_instance_postgresql_node_cpu_seconds_total | Total amount of CPU time consumed by the Database Instance, measured in seconds |
db_instance_postgresql_node_filesystem_avail_byte | Total amount of remaining available space, in bytes |
rdb_instance_postgresql_node_filesystem_size_bytes | Total size of the file system, in bytes |
db_instance_postgresql_node_memory_MemAvailable_bytes | Amount of memory available |
rdb_instance_postgresql_node_memory_MemTotal_bytes | Total installed physical memory (RAM) |
rdb_instance_postgresql_pg_replication_lag | Replica lag in seconds |
rdb_instance_postgresql_pg_settings_max_connection | Maximum number of concurrent Database Instance connections |
rdb_instance_postgresql_pg_stat_database_numbackends | Number of active Database Instance connections. |