Dameng
Dameng collector can collect the running status index from Dameng database instance.
Collector Configuration¶
Go to the conf.d/samples directory under the DataKit installation directory, copy dameng.conf.sample and name it dameng.conf. Examples are as follows:
[[inputs.dameng]]
# host name
host = "localhost"
## port
port = 5236
## user name
user = "SYSDBA"
## password
password = "datakit"
## database name
database = "DMTEST"
## Slow query threshold in milliseconds, default 1000
slow_query_threshold = 1000
## @param connect_timeout - number - optional - default: 10s
# connect_timeout = "10s"
interval = "10s"
## Set true to enable election
election = true
## Metric name in metric_exclude_list will not be collected.
#
metric_exclude_list = [""]
## Run a custom SQL query and collect corresponding metrics.
#
# [[inputs.dameng.custom_queries]]
# sql = 'SELECT name AS "name", stat_val AS "stat_val" FROM sys.v$sysstat;'
# metric = "dameng_custom_query"
# tags = ["name"]
# fields = ["stat_val"]
# interval = "30s"
## Log collection
#
[inputs.dameng.log]
# files = []
# pipeline = "dameng.p"
## The pattern should be a regexp. Note the use of '''this regexp'''
## regexp link: https://golang.org/pkg/regexp/syntax/#hdr-Syntax
multiline_match = '''^\\d{4}-\\d{2}-\\d{2}\\s+\\d{2}:\\d{2}:\\d{2}\\s+\\[.*?\\]'''
[inputs.dameng.tags]
# some_tag = "some_value"
# more_tag = "some_other_value"
After configuration, restart DataKit.
The collector can now be turned on by ConfigMap Injection Collector Configuration.
Metric¶
For all of the following data collections, the global election tags will added automatically, we can add extra tags in [inputs.dameng.tags] if needed:
dameng_memory¶
| Tags & Fields | Description |
|---|---|
| database ( tag) |
The name of the database |
| host ( tag) |
The server address or the host name |
| buffer_size_mb | Size of the buffer pool in MB. Type: float | (gauge) Unit: digital,MB Tagged by: database, host |
| mem_pool_size_mb | Size of the memory pool in MB. Type: float | (gauge) Unit: digital,MB Tagged by: database, host |
| total_size_mb | Total memory size (buffer pool + memory pool) in MB. Type: float | (gauge) Unit: digital,MB Tagged by: database, host |
dameng_mem_pool¶
| Tags & Fields | Description |
|---|---|
| database ( tag) |
The name of the database |
| host ( tag) |
The server address or the host name |
| is_overflow ( tag) |
Whether the memory pool is in overflow state (Y/N) |
| is_shared ( tag) |
Whether the memory pool is shared (Y/N) |
| pool_name ( tag) |
Name of the memory pool |
| data_size_mb | Data size in the memory pool in MB. Type: float | (gauge) Unit: digital,MB Tagged by: database, host, is_overflow, is_shared, pool_name |
| extend_size_mb | Size of extended memory in the pool. Type: int | (gauge) Unit: digital,MB Tagged by: database, host, is_overflow, is_shared, pool_name |
| n_extend_exclusive | Number of exclusive memory extensions. Type: int | (gauge) Unit: count Tagged by: database, host, is_overflow, is_shared, pool_name |
| n_extend_normal | Number of normal memory extensions. Type: int | (gauge) Unit: count Tagged by: database, host, is_overflow, is_shared, pool_name |
| org_size_mb | Original size of the memory pool in MB. Type: float | (gauge) Unit: digital,MB Tagged by: database, host, is_overflow, is_shared, pool_name |
| reserved_size_mb | Reserved size of the memory pool in MB. Type: float | (gauge) Unit: digital,MB Tagged by: database, host, is_overflow, is_shared, pool_name |
| target_size_mb | Target size of the memory pool. Type: int | (gauge) Unit: digital,MB Tagged by: database, host, is_overflow, is_shared, pool_name |
| total_size_mb | Total size of the memory pool in MB. Type: float | (gauge) Unit: digital,MB Tagged by: database, host, is_overflow, is_shared, pool_name |
dameng_tablespace¶
| Tags & Fields | Description |
|---|---|
| database ( tag) |
The name of the database |
| host ( tag) |
The server address or the host name |
| tablespace_name ( tag) |
Name of the table space |
| free_size_mb | Free size of the table space in MB. Type: float | (gauge) Unit: digital,MB Tagged by: database, host, tablespace_name |
| max_block_mb | Maximum block size in MB. Type: float | (gauge) Unit: digital,MB Tagged by: database, host, tablespace_name |
| total_size_mb | Total size of the table space in MB. Type: float | (gauge) Unit: digital,MB Tagged by: database, host, tablespace_name |
| usage_ratio | Usage ratio of the table space as a percentage. Type: float | (gauge) Unit: percent,percent Tagged by: database, host, tablespace_name |
| used_size_mb | Used size of the table space in MB. Type: float | (gauge) Unit: digital,MB Tagged by: database, host, tablespace_name |
dameng_connections¶
| Tags & Fields | Description |
|---|---|
| database ( tag) |
The name of the database |
| host ( tag) |
The server address or the host name |
| active_connections | Number of active connections to the database. Type: int | (gauge) Unit: count Tagged by: database, host |
| idle_connections | Number of idle connections in the database. Type: int | (gauge) Unit: count Tagged by: database, host |
| max_connections | Maximum number of connections allowed. Type: int | (gauge) Unit: count Tagged by: database, host |
dameng_rates¶
| Tags & Fields | Description |
|---|---|
| database ( tag) |
The name of the database |
| host ( tag) |
The server address or the host name |
| qps | Queries per second executed in the database. Type: float | (gauge) Unit: count Tagged by: database, host |
| tps | Transactions per second (commits + rollbacks) in the database. Type: float | (gauge) Unit: count Tagged by: database, host |
dameng_slow_query¶
| Tags & Fields | Description |
|---|---|
| database ( tag) |
The name of the database |
| host ( tag) |
The server address or the host name |
| sess_id ( tag) |
Session ID of the slow query |
| sql_id ( tag) |
Unique identifier of the slow query |
| sql_text ( tag) |
Truncated SQL query text. |
| exec_time | Execution time of the slow query in milliseconds. Type: int | (gauge) Unit: time,ms Tagged by: database, host, sess_id, sql_id, sql_text |
| n_runs | Number of times the slow query has been executed. Type: int | (gauge) Unit: count Tagged by: database, host, sess_id, sql_id, sql_text |
dameng_locks¶
| Tags & Fields | Description |
|---|---|
| database ( tag) |
The name of the database |
| host ( tag) |
The server address or the host name |
| waiting_locks | Number of waiting locks in the database. Type: int | (gauge) Unit: count Tagged by: database, host |
dameng_deadlock¶
| Tags & Fields | Description |
|---|---|
| database ( tag) |
The name of the database |
| host ( tag) |
The server address or the host name |
| sess_id ( tag) |
Session ID of the deadlock |
| trx_id ( tag) |
Transaction ID of the deadlock |
| deadlock_count | Number of times the deadlock has occurred. Type: int | (gauge) Unit: count Tagged by: database, host, sess_id, trx_id |
dameng_buffer_cache¶
| Tags & Fields | Description |
|---|---|
| database ( tag) |
The name of the database |
| host ( tag) |
The server address or the host name |
| pool_name ( tag) |
Name of the buffer pool |
| buffer_hit_ratio | Buffer cache hit ratio as a percentage. Type: float | (gauge) Unit: percent,percent Tagged by: database, host, pool_name |
| total_size_bytes | Total size of the buffer pool in bytes. Type: int | (gauge) Unit: digital,B Tagged by: database, host, pool_name |
| total_size_gb | Total size of the buffer pool in GB. Type: float | (gauge) Unit: digital,GB Tagged by: database, host, pool_name |
dameng_block_sessions¶
| Tags & Fields | Description |
|---|---|
| blocked_lock_type ( tag) |
Type of the lock causing the block (e.g., object_lock, transaction_lock) |
| blocked_sess_id ( tag) |
Session ID of the blocked session |
| blocked_start_time ( tag) |
Start time of the blocked session |
| blocked_trx_id ( tag) |
Transaction ID of the blocked session |
| blocking_ip ( tag) |
Client IP of the blocking session |
| blocking_sess_id ( tag) |
Session ID of the blocking session |
| blocking_trx_id ( tag) |
Transaction ID of the blocking session |
| database ( tag) |
The name of the database |
| host ( tag) |
The server address or the host name |
| block_duration_min | Duration of the block in minutes. Type: float | (gauge) Unit: time,min Tagged by: blocked_lock_type, blocked_sess_id, blocked_start_time, blocked_trx_id, blocking_ip, blocking_sess_id, blocking_trx_id, database, host |
Log Collection¶
-
During the operation of the Dameng database, some critical information is recorded in log files located in the
logdirectory under the installation directory, with the naming formatdm_<instance name>_YYYYMM.log. For example:dm_DMSERVER_202507.log. -
The Dameng collector does not have log collection enabled by default. You can open
filesin conf.d/samples/dameng.conf and write to the absolute path of the Dameng log file. For example:
When log collection is turned on, a log with a log source of dameng is generated by default.
Notices:
- Log collection only supports logs on hosts where DataKit is installed.
Log Pipeline Cut¶
The original log is
2025-07-03 10:16:20.659 [INFO] database P0000001485 T0000000000000001485 INI parameter ROLLSEG_POOLS changed, the original value 19, new value 1
Description of the cut field:
| Field name | Field Value | Description |
|---|---|---|
msg |
database P0000001485 T0000000000000001485 …… new value 1 |
Log content |
status |
info |
Current log level (ERROR,FATAL,WARNING,INFO) |
time |
1751537780 |
Log generation time |