plugin_name: go.d.plugin
modules:
  - meta:
      id: collector-go.d.plugin-maxscale
      plugin_name: go.d.plugin
      module_name: maxscale
      monitored_instance:
        name: MaxScale
        link: https://mariadb.com/kb/en/maxscale/
        categories:
          - data-collection.database-servers
        icon_filename: maxscale.svg
      related_resources:
        integrations:
          list: []
      alternative_monitored_instances: []
      info_provided_to_referring_integrations:
        description: ""
      keywords:
        - maria
        - mariadb
        - maxscale
        - database
        - db
      most_popular: false
    overview:
      data_collection:
        metrics_description: |
          This collector monitors the activity and performance of MaxScale servers.
        method_description: |
          It sends HTTP requests to the MaxScale [REST API](https://mariadb.com/kb/en/maxscale-24-02rest-api/).
      default_behavior:
        auto_detection:
          description: |
            The collector can automatically detect MaxScale instances running on:

            - localhost that are listening on port 8989
            - within Docker containers

            > **Note that the MaxScale REST API requires a username and password**. 
            > While Netdata can automatically detect MaxScale instances and create data collection jobs, these jobs will fail unless you provide the necessary credentials.
        limits:
          description: ""
        performance_impact:
          description: ""
      additional_permissions:
        description: ""
      multi_instance: true
      supported_platforms:
        include: []
        exclude: []
    setup:
      prerequisites:
        list: []
      configuration:
        file:
          name: go.d/maxscale.conf
        options:
          description: |
            The following options can be defined globally: update_every, autodetection_retry.
          folding:
            title: Config options
            enabled: true
          list:
            - name: update_every
              description: Data collection frequency.
              default_value: 1
              required: false
            - name: autodetection_retry
              description: Recheck interval in seconds. Zero means no recheck will be scheduled.
              default_value: 0
              required: false
            - name: url
              description: The URL of the MaxScale HTTP API endpoint.
              default_value: http://127.0.0.1:8989
              required: true
            - name: timeout
              description: HTTP request timeout.
              default_value: 1
              required: false
            - name: username
              description: Username for basic HTTP authentication.
              default_value: "admin"
              required: false
            - name: password
              description: Password for basic HTTP authentication.
              default_value: "mariadb"
              required: false
            - name: proxy_url
              description: Proxy URL.
              default_value: ""
              required: false
            - name: proxy_username
              description: Username for proxy basic HTTP authentication.
              default_value: ""
              required: false
            - name: proxy_password
              description: Password for proxy basic HTTP authentication.
              default_value: ""
              required: false
            - name: method
              description: HTTP request method.
              default_value: GET
              required: false
            - name: body
              description: HTTP request body.
              default_value: ""
              required: false
            - name: headers
              description: HTTP request headers.
              default_value: ""
              required: false
            - name: not_follow_redirects
              description: Redirect handling policy. Controls whether the client follows redirects.
              default_value: false
              required: false
            - name: tls_skip_verify
              description: Server certificate chain and hostname validation policy. Controls whether the client performs this check.
              default_value: false
              required: false
            - name: tls_ca
              description: Certification authority that the client uses when verifying the server's certificates.
              default_value: ""
              required: false
            - name: tls_cert
              description: Client TLS certificate.
              default_value: ""
              required: false
            - name: tls_key
              description: Client TLS key.
              default_value: ""
              required: false
        examples:
          folding:
            title: Config
            enabled: true
          list:
            - name: Basic
              description: A basic example configuration.
              folding:
                enabled: false
              config: |
                jobs:
                  - name: local
                    url: http://127.0.0.1:8989
                    username: admin
                    password: mariadb
            - name: HTTPS with self-signed certificate
              description: MaxScale with enabled HTTPS and self-signed certificate.
              config: |
                jobs:
                  - name: local
                    url: http://127.0.0.1:8989
                    username: admin
                    password: mariadb
                    tls_skip_verify: yes
            - name: Multi-instance
              description: |
                > **Note**: When you define multiple jobs, their names must be unique.
                
                Collecting metrics from local and remote instances.
              config: |
                jobs:
                  - name: local
                    url: http://127.0.0.1:8989
                    username: admin
                    password: mariadb
                
                  - name: remote
                    url: http://192.0.2.1:8989
                    username: admin
                    password: mariadb
    troubleshooting:
      problems:
        list: []
    alerts: []
    metrics:
      folding:
        title: Metrics
        enabled: false
      description: ""
      availability: []
      scopes:
        - name: global
          description: These metrics refer to the monitored MaxScale instance.
          labels: []
          metrics:
            - name: maxscale.poll_events
              description: Poll Events
              unit: events/s
              chart_type: line
              dimensions:
                - name: reads
                - name: writes
                - name: accepts
                - name: errors
                - name: hangups
            - name: maxscale.current_sessions
              description: Current Sessions
              unit: sessions
              chart_type: line
              dimensions:
                - name: sessions
            - name: maxscale.current_zombie_connections
              description: Current Zombie Connections
              unit: connections
              chart_type: line
              dimensions:
                - name: zombie
            - name: maxscale.threads_by_state
              description: Threads Count by State
              unit: threads
              chart_type: stacked
              dimensions:
                - name: active
                - name: draining
                - name: dormant
            - name: maxscale.current_fds
              description: Current Managed File Descriptors
              unit: fds
              chart_type: line
              dimensions:
                - name: managed
            - name: maxscale.qc_cache_efficiency
              description: QC Cache Efficiency
              unit: requests/s
              chart_type: stacked
              dimensions:
                - name: hits
                - name: misses
            - name: maxscale.qc_cache_operations
              description: QC Cache Operations
              unit: operations/s
              chart_type: stacked
              dimensions:
                - name: inserts
                - name: evictions
            - name: maxscale.uptime
              description: Uptime
              unit: seconds
              chart_type: line
              dimensions:
                - name: uptime
        - name: server
          description: These metrics refer to the MariaDB server.
          labels:
            - name: server
              description: Server ID.
            - name: address
              description: Server address.
          metrics:
            - name: maxscale.server_state
              description: Server State
              unit: state
              chart_type: line
              dimensions:
                - name: master
                - name: slave
                - name: running
                - name: down
                - name: maintenance
                - name: draining
                - name: drained
                - name: relay_master
                - name: binlog_relay
                - name: synced
            - name: maxscale.server_current_connections
              description: Server Current connections
              unit: connections
              chart_type: line
              dimensions:
                - name: connections
