Database monitoring
Database monitoring#
To monitor databases in K2 Cloud, we recommend enabling cloud Prometheus-based monitoring service. If you have your own Prometheus- or Zabbix-based monitoring server, you can connect PaaS services to it.
Databases in K2 Cloud are deployed with monitoring agents already installed. Exporters from the Prometheus project ecosystem are used as agents. Each of them runs in the background mode and listens to a specific port. You can make an HTTP GET request to the port at any time to get the metrics.
Exporter |
PaaS |
Metrics |
Metric collection point |
Description |
---|---|---|---|---|
node_exporter |
All services |
Host properties, OS metrics, utilization of system resources |
||
mysqld_exporter |
MySQL |
Variables and statuses of a running DBMS, full list of MySQL metrics |
||
postgres_exporter |
PostgreSQL |
Metrics of a running DBMS, full list of PostgreSQL metrics |
||
redis_exporter |
Redis |
Metrics of a running DBMS, full list of Redis metrics |
||
mongodb_exporter |
MongoDB |
Metrics of a running DBMS, full list of Mongo DB metrics |
DBMS listens to addresses and ports can be found in the Information tab.
You can use addresses not only to connect applications to the DBMS but also to connect to monitoring agents.
For example, to get metrics from MySQL that listens to the following addresses:
you need to use the following cluster endpoints:
And to get metrics from the host and VM OS, you should use the following endpoints:
For a Prometheus server, the configuration for working with such a service might look like this (http:// and /metrics are default values and are not specified in the given configuration for connection points):
scrape_configs:
- job_name: node
static_configs:
- targets:
- 172.31.1.37:9100
- 172.31.0.55:9100
- 172.31.2.40:9100
- job_name: mysqld
static_configs:
- targets:
- 172.31.1.37:9104
- 172.31.0.55:9104
- 172.31.2.40:9104
Zabbix monitoring server can also use data that exporters provide via integration with the help of their HTTP client; for details, see.