github.com/netdata/go.d.plugin@v0.58.1/modules/haproxy/integrations/haproxy.md (about) 1 <!--startmeta 2 custom_edit_url: "https://github.com/netdata/go.d.plugin/edit/master/modules/haproxy/README.md" 3 meta_yaml: "https://github.com/netdata/go.d.plugin/edit/master/modules/haproxy/metadata.yaml" 4 sidebar_label: "HAProxy" 5 learn_status: "Published" 6 learn_rel_path: "Data Collection/Web Servers and Web Proxies" 7 most_popular: False 8 message: "DO NOT EDIT THIS FILE DIRECTLY, IT IS GENERATED BY THE COLLECTOR'S metadata.yaml FILE" 9 endmeta--> 10 11 # HAProxy 12 13 14 <img src="https://netdata.cloud/img/haproxy.svg" width="150"/> 15 16 17 Plugin: go.d.plugin 18 Module: haproxy 19 20 <img src="https://img.shields.io/badge/maintained%20by-Netdata-%2300ab44" /> 21 22 ## Overview 23 24 This collector monitors HAProxy servers. 25 26 27 28 29 This collector is supported on all platforms. 30 31 This collector supports collecting metrics from multiple instances of this integration, including remote instances. 32 33 34 ### Default Behavior 35 36 #### Auto-Detection 37 38 This integration doesn't support auto-detection. 39 40 #### Limits 41 42 The default configuration for this integration does not impose any limits on data collection. 43 44 #### Performance Impact 45 46 The default configuration for this integration is not expected to impose a significant performance impact on the system. 47 48 49 ## Metrics 50 51 Metrics grouped by *scope*. 52 53 The scope defines the instance that the metric belongs to. An instance is uniquely identified by a set of labels. 54 55 56 57 ### Per HAProxy instance 58 59 These metrics refer to the entire monitored application. 60 61 This scope has no labels. 62 63 Metrics: 64 65 | Metric | Dimensions | Unit | 66 |:------|:----------|:----| 67 | haproxy.backend_current_sessions | a dimension per proxy | sessions | 68 | haproxy.backend_sessions | a dimension per proxy | sessions/s | 69 | haproxy.backend_response_time_average | a dimension per proxy | milliseconds | 70 | haproxy.backend_queue_time_average | a dimension per proxy | milliseconds | 71 | haproxy.backend_current_queue | a dimension per proxy | requests | 72 73 ### Per proxy 74 75 These metrics refer to the Proxy. 76 77 This scope has no labels. 78 79 Metrics: 80 81 | Metric | Dimensions | Unit | 82 |:------|:----------|:----| 83 | haproxy.backend_http_responses | 1xx, 2xx, 3xx, 4xx, 5xx, other | responses/s | 84 | haproxy.backend_network_io | in, out | bytes/s | 85 86 87 88 ## Alerts 89 90 There are no alerts configured by default for this integration. 91 92 93 ## Setup 94 95 ### Prerequisites 96 97 #### Enable PROMEX addon. 98 99 To enable PROMEX addon, follow the [official documentation](https://github.com/haproxy/haproxy/tree/master/addons/promex). 100 101 102 103 ### Configuration 104 105 #### File 106 107 The configuration file name for this integration is `go.d/haproxy.conf`. 108 109 110 You can edit the configuration file using the `edit-config` script from the 111 Netdata [config directory](https://github.com/netdata/netdata/blob/master/docs/configure/nodes.md#the-netdata-config-directory). 112 113 ```bash 114 cd /etc/netdata 2>/dev/null || cd /opt/netdata/etc/netdata 115 sudo ./edit-config go.d/haproxy.conf 116 ``` 117 #### Options 118 119 The following options can be defined globally: update_every, autodetection_retry. 120 121 122 <details><summary>Config options</summary> 123 124 | Name | Description | Default | Required | 125 |:----|:-----------|:-------|:--------:| 126 | update_every | Data collection frequency. | 1 | no | 127 | autodetection_retry | Recheck interval in seconds. Zero means no recheck will be scheduled. | 0 | no | 128 | url | Server URL. | http://127.0.0.1 | yes | 129 | timeout | HTTP request timeout. | 1 | no | 130 | username | Username for basic HTTP authentication. | | no | 131 | password | Password for basic HTTP authentication. | | no | 132 | proxy_url | Proxy URL. | | no | 133 | proxy_username | Username for proxy basic HTTP authentication. | | no | 134 | proxy_password | Password for proxy basic HTTP authentication. | | no | 135 | method | HTTP request method. | GET | no | 136 | body | HTTP request body. | | no | 137 | headers | HTTP request headers. | | no | 138 | not_follow_redirects | Redirect handling policy. Controls whether the client follows redirects. | no | no | 139 | tls_skip_verify | Server certificate chain and hostname validation policy. Controls whether the client performs this check. | no | no | 140 | tls_ca | Certification authority that the client uses when verifying the server's certificates. | | no | 141 | tls_cert | Client TLS certificate. | | no | 142 | tls_key | Client TLS key. | | no | 143 144 </details> 145 146 #### Examples 147 148 ##### Basic 149 150 A basic example configuration. 151 152 <details><summary>Config</summary> 153 154 ```yaml 155 jobs: 156 - name: local 157 url: http://127.0.0.1:8404/metrics 158 159 ``` 160 </details> 161 162 ##### HTTP authentication 163 164 Basic HTTP authentication. 165 166 <details><summary>Config</summary> 167 168 ```yaml 169 jobs: 170 - name: local 171 url: http://127.0.0.1:8404/metrics 172 username: username 173 password: password 174 175 ``` 176 </details> 177 178 ##### HTTPS with self-signed certificate 179 180 NGINX Plus with enabled HTTPS and self-signed certificate. 181 182 <details><summary>Config</summary> 183 184 ```yaml 185 jobs: 186 - name: local 187 url: https://127.0.0.1:8404/metrics 188 tls_skip_verify: yes 189 190 ``` 191 </details> 192 193 ##### Multi-instance 194 195 > **Note**: When you define multiple jobs, their names must be unique. 196 197 Collecting metrics from local and remote instances. 198 199 200 <details><summary>Config</summary> 201 202 ```yaml 203 jobs: 204 - name: local 205 url: http://127.0.0.1:8404/metrics 206 207 - name: remote 208 url: http://192.0.2.1:8404/metrics 209 210 ``` 211 </details> 212 213 214 215 ## Troubleshooting 216 217 ### Debug Mode 218 219 To troubleshoot issues with the `haproxy` collector, run the `go.d.plugin` with the debug option enabled. The output 220 should give you clues as to why the collector isn't working. 221 222 - Navigate to the `plugins.d` directory, usually at `/usr/libexec/netdata/plugins.d/`. If that's not the case on 223 your system, open `netdata.conf` and look for the `plugins` setting under `[directories]`. 224 225 ```bash 226 cd /usr/libexec/netdata/plugins.d/ 227 ``` 228 229 - Switch to the `netdata` user. 230 231 ```bash 232 sudo -u netdata -s 233 ``` 234 235 - Run the `go.d.plugin` to debug the collector: 236 237 ```bash 238 ./go.d.plugin -d -m haproxy 239 ``` 240 241