diff --git a/etc/config_properties/monagent_pipeline.yaml b/etc/config_properties/monagent_pipeline.yaml index c32341006949aa7110cd57fc62e638a83240e260..1e42b119c19a50437156e3fe33880406da2499c3 100644 --- a/etc/config_properties/monagent_pipeline.yaml +++ b/etc/config_properties/monagent_pipeline.yaml @@ -1,5 +1,18 @@ configVersion: "2021-08-20T07:52:28.5443+08:00" configs: + - key: monagent.mysql.monitor.user + value: mysql_monitor_user + valueType: string + - key: monagent.mysql.monitor.password + value: mysql_monitor_password + valueType: string + encrypted: true + - key: monagent.mysql.sql.port + value: 3306 + valueType: int64 + - key: monagent.mysql.host + value: 127.0.0.1 + valueType: string - key: monagent.ob.monitor.user value: {monitor_user} valueType: string @@ -40,3 +53,6 @@ configs: - key: monagent.alertmanager.address value: {alertmanager_address} valueType: string + - key: monagent.pipeline.mysql.status + value: inactive + valueType: string diff --git a/etc/module_config/monitor_mysql.yaml b/etc/module_config/monitor_mysql.yaml new file mode 100644 index 0000000000000000000000000000000000000000..bfd6fd1dc5f2a2452ff6865dbf3e145466695916 --- /dev/null +++ b/etc/module_config/monitor_mysql.yaml @@ -0,0 +1,42 @@ +mysqldInput: &mysqldInput + plugin: mysqldInput + config: + timeout: 10s + pluginConfig: + dsn: ${monagent.mysql.monitor.user}:${monagent.mysql.monitor.password}@(${monagent.mysql.host}:${monagent.mysql.sql.port})/ + +retagProcessor: &retagProcessor + plugin: retagProcessor + config: + timout: 10s + pluginConfig: + newTags: + app: MYSQL + svr_ip: ${monagent.host.ip} + +prometheusExporter: &prometheusExporter + plugin: prometheusExporter + config: + timout: 10s + pluginConfig: + formatType: fmtText + +modules: + - module: monitor.mysql + moduleType: monagent.pipeline + process: monagent + config: + name: monitor.mysql + status: ${monagent.pipeline.mysql.status} + pipelines: + - name: mysql_info + config: + scheduleStrategy: trigger + exposeUrl: /metrics/mysql + structure: + inputs: + - <<: *mysqldInput + processors: + - <<: *retagProcessor + exporter: + <<: *prometheusExporter