NavigationContentFooter
Jump toSuggest an edit

How to monitor your Database Instance with Scaleway Cockpit

Reviewed on 19 June 2024Published on 19 June 2024

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.
  1. Create a Grafana user and retrieve their username and password by following this procedure.

  2. From the Scaleway console Cockpit overview page, click Open dashboards in the top right corner.

  3. 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

  1. Click Open dashboards on the top right from the Scaleway Cockpit dashboards homepage.

  2. 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 to VERBOSE for PostgreSQL and 2 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 with long_query_time.

How to activate preconfigured alerts

You can activate Scaleway preconfigured alerts for your Managed Databases with Scaleway Cockpit.

Note

Refer to the How to activate preconfigured alerts to learn how to do so.

By default, three preconfigured alerts are available for Managed Databases:

  • MySQLHighStorageUsage or PostgreSQLHighStorageUsage- You are alerted if disk usage is higher than 80% for 10 consecutive minutes.
  • MySQLHighCPULoad or PostgreSQLHighCPULoad- You are alerted if CPU usage is higher than 80% for 10 consecutive minutes.
  • MySQLTooManyConnections or PostgreSQLTooManyConnections- 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

AlertDescription
rdb_instance_mysql_mysql_global_status_threads_connectedTotal active connections on MySQL
rdb_instance_mysql_mysql_global_variables_max_connectionsMaximum number of connections configured
rdb_instance_mysql_mysql_slave_status_seconds_behind_masterReplica lag in seconds
rdb_instance_mysql_node_cpu_seconds_totalTotal amount of CPU time consumed by the Database Instance, measured in seconds
rdb_instance_mysql_node_filesystem_avail_bytesTotal amount of remaining available space, in bytes
rdb_instance_mysql_node_filesystem_size_bytesTotal size of the filesystem, in bytes
b_instance_mysql_node_memory_MemAvailable_bytesAmount of memory available
rdb_instance_mysql_node_memory_MemTotal_bytesTotal installed physical memory (RAM)

PostgreSQL

AlertDescription
rdb_instance_postgresql_node_cpu_seconds_totalTotal amount of CPU time consumed by the Database Instance, measured in seconds
db_instance_postgresql_node_filesystem_avail_byteTotal amount of remaining available space, in bytes
rdb_instance_postgresql_node_filesystem_size_bytesTotal size of the filesystem, in bytes
db_instance_postgresql_node_memory_MemAvailable_bytesAmount of memory available
rdb_instance_postgresql_node_memory_MemTotal_bytesTotal installed physical memory (RAM)
rdb_instance_postgresql_pg_replication_lagReplica lag in seconds
rdb_instance_postgresql_pg_settings_max_connectionMaximum number of concurrent Database Instance connections
rdb_instance_postgresql_pg_stat_database_numbackendsNumber of active Database Instance connections.
See also
How to manage allowed IPsHow to change the volume type
Docs APIScaleway consoleDedibox consoleScaleway LearningScaleway.comPricingBlogCarreer
© 2023-2024 – Scaleway