| 1 | package db2 |
| 2 | |
| 3 | import ( |
| 4 | "github.com/netdata/netdata/go/plugins/pkg/confopt" |
| 5 | "github.com/netdata/netdata/go/plugins/plugin/ibm.d/framework" |
| 6 | ) |
| 7 | |
| 8 | // Config defines the user-facing configuration for the DB2 collector. |
| 9 | type Config struct { |
| 10 | framework.Config `yaml:",inline" json:",inline"` |
| 11 | |
| 12 | // Vnode allows binding the collector to a virtual node. |
| 13 | Vnode string `yaml:"vnode,omitempty" json:"vnode" ui:"group:Connection"` |
| 14 | |
| 15 | // DSN provides a full DB2 connection string when manual control is required. |
| 16 | DSN string `yaml:"dsn" json:"dsn" ui:"group:Connection"` |
| 17 | |
| 18 | // Timeout controls how long DB2 RPCs may run before cancellation. |
| 19 | Timeout confopt.Duration `yaml:"timeout,omitempty" json:"timeout" ui:"group:Connection"` |
| 20 | |
| 21 | // MaxDbConns limits the connection pool size. |
| 22 | MaxDbConns int `yaml:"max_db_conns,omitempty" json:"max_db_conns" ui:"group:Advanced"` |
| 23 | |
| 24 | // MaxDbLifeTime forces pooled connections to be recycled after the specified duration. |
| 25 | MaxDbLifeTime confopt.Duration `yaml:"max_db_life_time,omitempty" json:"max_db_life_time" ui:"group:Advanced"` |
| 26 | |
| 27 | // CollectDatabaseMetrics toggles high-level database status metrics. |
| 28 | CollectDatabaseMetrics confopt.AutoBool `yaml:"collect_database_metrics,omitempty" json:"collect_database_metrics" ui:"group:Databases"` |
| 29 | |
| 30 | // CollectBufferpoolMetrics toggles buffer pool efficiency metrics. |
| 31 | CollectBufferpoolMetrics confopt.AutoBool `yaml:"collect_bufferpool_metrics,omitempty" json:"collect_bufferpool_metrics" ui:"group:Buffer Pools"` |
| 32 | |
| 33 | // CollectTablespaceMetrics toggles tablespace capacity metrics. |
| 34 | CollectTablespaceMetrics confopt.AutoBool `yaml:"collect_tablespace_metrics,omitempty" json:"collect_tablespace_metrics" ui:"group:Tablespaces"` |
| 35 | |
| 36 | // CollectConnectionMetrics toggles per-connection activity metrics. |
| 37 | CollectConnectionMetrics confopt.AutoBool `yaml:"collect_connection_metrics,omitempty" json:"collect_connection_metrics" ui:"group:Connections Monitoring"` |
| 38 | |
| 39 | // CollectLockMetrics toggles lock contention metrics. |
| 40 | CollectLockMetrics confopt.AutoBool `yaml:"collect_lock_metrics,omitempty" json:"collect_lock_metrics" ui:"group:Other Metrics"` |
| 41 | |
| 42 | // CollectTableMetrics toggles table-level size and row metrics. |
| 43 | CollectTableMetrics confopt.AutoBool `yaml:"collect_table_metrics,omitempty" json:"collect_table_metrics" ui:"group:Tables"` |
| 44 | |
| 45 | // CollectIndexMetrics toggles index usage metrics. |
| 46 | CollectIndexMetrics confopt.AutoBool `yaml:"collect_index_metrics,omitempty" json:"collect_index_metrics" ui:"group:Indexes"` |
| 47 | |
| 48 | // MaxDatabases caps the number of databases charted. |
| 49 | MaxDatabases int `yaml:"max_databases,omitempty" json:"max_databases" ui:"group:Databases"` |
| 50 | |
| 51 | // MaxBufferpools caps the number of buffer pools charted. |
| 52 | MaxBufferpools int `yaml:"max_bufferpools,omitempty" json:"max_bufferpools" ui:"group:Buffer Pools"` |
| 53 | |
| 54 | // MaxTablespaces caps the number of tablespaces charted. |
| 55 | MaxTablespaces int `yaml:"max_tablespaces,omitempty" json:"max_tablespaces" ui:"group:Tablespaces"` |
| 56 | |
| 57 | // MaxConnections caps the number of connection instances charted. |
| 58 | MaxConnections int `yaml:"max_connections,omitempty" json:"max_connections" ui:"group:Connections Monitoring"` |
| 59 | |
| 60 | // MaxTables caps the number of tables charted. |
| 61 | MaxTables int `yaml:"max_tables,omitempty" json:"max_tables" ui:"group:Tables"` |
| 62 | |
| 63 | // MaxIndexes caps the number of indexes charted. |
| 64 | MaxIndexes int `yaml:"max_indexes,omitempty" json:"max_indexes" ui:"group:Indexes"` |
| 65 | |
| 66 | // BackupHistoryDays controls how many days of backup history are retrieved. |
| 67 | BackupHistoryDays int `yaml:"backup_history_days,omitempty" json:"backup_history_days" ui:"group:Advanced"` |
| 68 | |
| 69 | // CollectMemoryMetrics enables memory pool statistics. |
| 70 | CollectMemoryMetrics bool `yaml:"collect_memory_metrics,omitempty" json:"collect_memory_metrics" ui:"group:Other Metrics"` |
| 71 | |
| 72 | // CollectWaitMetrics enables wait time statistics (locks, logs, I/O). |
| 73 | CollectWaitMetrics bool `yaml:"collect_wait_metrics,omitempty" json:"collect_wait_metrics" ui:"group:Other Metrics"` |
| 74 | |
| 75 | // CollectTableIOMetrics enables table I/O statistics when available. |
| 76 | CollectTableIOMetrics bool `yaml:"collect_table_io_metrics,omitempty" json:"collect_table_io_metrics" ui:"group:Other Metrics"` |
| 77 | |
| 78 | // CollectDatabasesMatching filters databases by name using glob patterns. |
| 79 | CollectDatabasesMatching string `yaml:"collect_databases_matching,omitempty" json:"collect_databases_matching" ui:"group:Databases"` |
| 80 | |
| 81 | // IncludeConnections filters monitored connections by application ID or application name (wildcards supported). |
| 82 | IncludeConnections []string `yaml:"include_connections,omitempty" json:"include_connections" ui:"group:Connections Monitoring"` |
| 83 | // ExcludeConnections excludes connections after inclusion matching. |
| 84 | ExcludeConnections []string `yaml:"exclude_connections,omitempty" json:"exclude_connections" ui:"group:Connections Monitoring"` |
| 85 | |
| 86 | // IncludeBufferpools filters buffer pools by name. |
| 87 | IncludeBufferpools []string `yaml:"include_bufferpools,omitempty" json:"include_bufferpools" ui:"group:Buffer Pools"` |
| 88 | // ExcludeBufferpools excludes buffer pools after inclusion. |
| 89 | ExcludeBufferpools []string `yaml:"exclude_bufferpools,omitempty" json:"exclude_bufferpools" ui:"group:Buffer Pools"` |
| 90 | |
| 91 | // IncludeTablespaces filters tablespaces by name. |
| 92 | IncludeTablespaces []string `yaml:"include_tablespaces,omitempty" json:"include_tablespaces" ui:"group:Tablespaces"` |
| 93 | // ExcludeTablespaces excludes tablespaces after inclusion. |
| 94 | ExcludeTablespaces []string `yaml:"exclude_tablespaces,omitempty" json:"exclude_tablespaces" ui:"group:Tablespaces"` |
| 95 | |
| 96 | // IncludeTables filters tables by schema/name. |
| 97 | IncludeTables []string `yaml:"include_tables,omitempty" json:"include_tables" ui:"group:Tables"` |
| 98 | // ExcludeTables excludes tables after inclusion. |
| 99 | ExcludeTables []string `yaml:"exclude_tables,omitempty" json:"exclude_tables" ui:"group:Tables"` |
| 100 | |
| 101 | // IncludeIndexes filters indexes by schema/name. |
| 102 | IncludeIndexes []string `yaml:"include_indexes,omitempty" json:"include_indexes" ui:"group:Indexes"` |
| 103 | // ExcludeIndexes excludes indexes after inclusion. |
| 104 | ExcludeIndexes []string `yaml:"exclude_indexes,omitempty" json:"exclude_indexes" ui:"group:Indexes"` |
| 105 | } |