Dameng
Dameng collector can collect the running status index from Dameng database instance.
Collector Configuration¶
Go to the conf.d/db
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 Unit: digital,MB |
mem_pool_size_mb | Size of the memory pool in MB. Type: float Unit: digital,MB |
total_size_mb | Total memory size (buffer pool + memory pool) in MB. Type: float Unit: digital,MB |
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 Unit: digital,MB |
extend_size | Size of extended memory in the pool. Type: int Unit: count |
n_extend_exclusive | Number of exclusive memory extensions. Type: int Unit: count |
n_extend_normal | Number of normal memory extensions. Type: int Unit: count |
org_size_mb | Original size of the memory pool in MB. Type: float Unit: digital,MB |
reserved_size_mb | Reserved size of the memory pool in MB. Type: float Unit: digital,MB |
target_size | Target size of the memory pool. Type: int Unit: count |
total_size_mb | Total size of the memory pool in MB. Type: float Unit: digital,MB |
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 Unit: digital,MB |
max_block_mb | Maximum block size in MB. Type: float Unit: digital,MB |
total_size_mb | Total size of the table space in MB. Type: float Unit: digital,MB |
usage_ratio | Usage ratio of the table space as a percentage. Type: float Unit: percent,percent |
used_size_mb | Used size of the table space in MB. Type: float Unit: digital,MB |
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 Unit: count |
idle_connections | Number of idle connections in the database. Type: int Unit: count |
max_connections | Maximum number of connections allowed. Type: int Unit: count |
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 Unit: count |
tps | Transactions per second (commits + rollbacks) in the database. Type: float Unit: count |
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 Unit: time,ms |
n_runs | Number of times the slow query has been executed. Type: int Unit: count |
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 Unit: count |
dameng_deadlock
¶
Tags & Fields | Description |
---|---|
database ( tag ) |
The name of the database |
deadlock_sess_id ( tag ) |
Session ID of the deadlock |
deadlock_trx_id ( tag ) |
Transaction ID of the deadlock |
host ( tag ) |
The server address or the host name |
deadlock_count | Number of times the deadlock has occurred. Type: int Unit: count |
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 Unit: percent,percent |
total_size_bytes | Total size of the buffer pool in bytes. Type: int Unit: digital,B |
total_size_gb | Total size of the buffer pool in GB. Type: float Unit: digital,GB |
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 Unit: time,min |
Log Collection¶
-
During the operation of the Dameng database, some critical information is recorded in log files located in the
log
directory 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
files
in conf.d/db/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 |