monitor_mysql.yaml 1.0 KB
Newer Older
C
chris-sun-star 已提交
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 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