github.com/netdata/go.d.plugin@v0.58.1/modules/httpcheck/integrations/http_endpoints.md (about)

     1  <!--startmeta
     2  custom_edit_url: "https://github.com/netdata/go.d.plugin/edit/master/modules/httpcheck/README.md"
     3  meta_yaml: "https://github.com/netdata/go.d.plugin/edit/master/modules/httpcheck/metadata.yaml"
     4  sidebar_label: "HTTP Endpoints"
     5  learn_status: "Published"
     6  learn_rel_path: "Data Collection/Synthetic Checks"
     7  most_popular: True
     8  message: "DO NOT EDIT THIS FILE DIRECTLY, IT IS GENERATED BY THE COLLECTOR'S metadata.yaml FILE"
     9  endmeta-->
    10  
    11  # HTTP Endpoints
    12  
    13  
    14  <img src="https://netdata.cloud/img/globe.svg" width="150"/>
    15  
    16  
    17  Plugin: go.d.plugin
    18  Module: httpcheck
    19  
    20  <img src="https://img.shields.io/badge/maintained%20by-Netdata-%2300ab44" />
    21  
    22  ## Overview
    23  
    24  This collector monitors HTTP servers availability and response time.
    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 target
    58  
    59  The metrics refer to the monitored target.
    60  
    61  Labels:
    62  
    63  | Label      | Description     |
    64  |:-----------|:----------------|
    65  | url | url value that is set in the configuration file. |
    66  
    67  Metrics:
    68  
    69  | Metric | Dimensions | Unit |
    70  |:------|:----------|:----|
    71  | httpcheck.response_time | time | ms |
    72  | httpcheck.response_length | length | characters |
    73  | httpcheck.status | success, timeout, redirect, no_connection, bad_content, bad_header, bad_status | boolean |
    74  | httpcheck.in_state | time | boolean |
    75  
    76  
    77  
    78  ## Alerts
    79  
    80  There are no alerts configured by default for this integration.
    81  
    82  
    83  ## Setup
    84  
    85  ### Prerequisites
    86  
    87  No action required.
    88  
    89  ### Configuration
    90  
    91  #### File
    92  
    93  The configuration file name for this integration is `go.d/httpcheck.conf`.
    94  
    95  
    96  You can edit the configuration file using the `edit-config` script from the
    97  Netdata [config directory](https://github.com/netdata/netdata/blob/master/docs/configure/nodes.md#the-netdata-config-directory).
    98  
    99  ```bash
   100  cd /etc/netdata 2>/dev/null || cd /opt/netdata/etc/netdata
   101  sudo ./edit-config go.d/httpcheck.conf
   102  ```
   103  #### Options
   104  
   105  The following options can be defined globally: update_every, autodetection_retry.
   106  
   107  
   108  <details><summary>Config options</summary>
   109  
   110  | Name | Description | Default | Required |
   111  |:----|:-----------|:-------|:--------:|
   112  | update_every | Data collection frequency. | 1 | no |
   113  | autodetection_retry | Recheck interval in seconds. Zero means no recheck will be scheduled. | 0 | no |
   114  | url | Server URL. |  | yes |
   115  | status_accepted | HTTP accepted response statuses. Anything else will result in 'bad status' in the status chart. | [200] | no |
   116  | response_match | If the status code is accepted, the content of the response will be matched against this regular expression. |  | no |
   117  | headers_match | This option defines a set of rules that check for specific key-value pairs in the HTTP headers of the response. | [] | no |
   118  | headers_match.exclude | This option determines whether the rule should check for the presence of the specified key-value pair or the absence of it. | no | no |
   119  | headers_match.key | The exact name of the HTTP header to check for. |  | yes |
   120  | headers_match.value | The [pattern](https://github.com/netdata/go.d.plugin/tree/master/pkg/matcher#supported-format) to match against the value of the specified header. |  | no |
   121  | cookie_file | Path to cookie file. See [cookie file format](https://everything.curl.dev/http/cookies/fileformat). |  | no |
   122  | timeout | HTTP request timeout. | 1 | no |
   123  | username | Username for basic HTTP authentication. |  | no |
   124  | password | Password for basic HTTP authentication. |  | no |
   125  | proxy_url | Proxy URL. |  | no |
   126  | proxy_username | Username for proxy basic HTTP authentication. |  | no |
   127  | proxy_password | Password for proxy basic HTTP authentication. |  | no |
   128  | method | HTTP request method. | GET | no |
   129  | body | HTTP request body. |  | no |
   130  | headers | HTTP request headers. |  | no |
   131  | not_follow_redirects | Redirect handling policy. Controls whether the client follows redirects. | no | no |
   132  | tls_skip_verify | Server certificate chain and hostname validation policy. Controls whether the client performs this check. | no | no |
   133  | tls_ca | Certification authority that the client uses when verifying the server's certificates. |  | no |
   134  | tls_cert | Client TLS certificate. |  | no |
   135  | tls_key | Client TLS key. |  | no |
   136  
   137  </details>
   138  
   139  #### Examples
   140  
   141  ##### Basic
   142  
   143  A basic example configuration.
   144  
   145  <details><summary>Config</summary>
   146  
   147  ```yaml
   148  jobs:
   149    - name: local
   150      url: http://127.0.0.1:8080
   151  
   152  ```
   153  </details>
   154  
   155  ##### With `status_accepted`
   156  
   157  A basic example configuration with non-default status_accepted.
   158  
   159  <details><summary>Config</summary>
   160  
   161  ```yaml
   162  jobs:
   163    - name: local
   164      url: http://127.0.0.1:8080
   165      status_accepted:
   166        - 200
   167        - 204
   168  
   169  ```
   170  </details>
   171  
   172  ##### With `header_match`
   173  
   174  Example configurations with `header_match`. See the value [pattern](https://github.com/netdata/go.d.plugin/tree/master/pkg/matcher#supported-format) syntax.
   175  
   176  <details><summary>Config</summary>
   177  
   178  ```yaml
   179  jobs:
   180      # The "X-Robots-Tag" header must be present in the HTTP response header,
   181      # but the value of the header does not matter.
   182      # This config checks for the presence of the header regardless of its value.
   183    - name: local
   184      url: http://127.0.0.1:8080
   185      header_match:
   186        - key: X-Robots-Tag
   187  
   188      # The "X-Robots-Tag" header must be present in the HTTP response header
   189      # only if its value is equal to "noindex, nofollow".
   190      # This config checks both the presence of the header and its value.
   191    - name: local
   192      url: http://127.0.0.1:8080
   193      header_match:
   194        - key: X-Robots-Tag
   195          value: '= noindex,nofollow'
   196  
   197      # The "X-Robots-Tag" header must not be present in the HTTP response header
   198      # but the value of the header does not matter.
   199      # This config checks for the presence of the header regardless of its value.
   200    - name: local
   201      url: http://127.0.0.1:8080
   202      header_match:
   203        - key: X-Robots-Tag
   204          exclude: yes
   205  
   206      # The "X-Robots-Tag" header must not be present in the HTTP response header
   207      # only if its value is equal to "noindex, nofollow".
   208      # This config checks both the presence of the header and its value.
   209    - name: local
   210      url: http://127.0.0.1:8080
   211      header_match:
   212        - key: X-Robots-Tag
   213          exclude: yes
   214          value: '= noindex,nofollow'
   215  
   216  ```
   217  </details>
   218  
   219  ##### HTTP authentication
   220  
   221  Basic HTTP authentication.
   222  
   223  <details><summary>Config</summary>
   224  
   225  ```yaml
   226  jobs:
   227    - name: local
   228      url: http://127.0.0.1:8080
   229      username: username
   230      password: password
   231  
   232  ```
   233  </details>
   234  
   235  ##### HTTPS with self-signed certificate
   236  
   237  Do not validate server certificate chain and hostname.
   238  
   239  
   240  <details><summary>Config</summary>
   241  
   242  ```yaml
   243  jobs:
   244    - name: local
   245      url: https://127.0.0.1:8080
   246      tls_skip_verify: yes
   247  
   248  ```
   249  </details>
   250  
   251  ##### Multi-instance
   252  
   253  > **Note**: When you define multiple jobs, their names must be unique.
   254  
   255  Collecting metrics from local and remote instances.
   256  
   257  
   258  <details><summary>Config</summary>
   259  
   260  ```yaml
   261  jobs:
   262    - name: local
   263      url: http://127.0.0.1:8080
   264  
   265    - name: remote
   266      url: http://192.0.2.1:8080
   267  
   268  ```
   269  </details>
   270  
   271  
   272  
   273  ## Troubleshooting
   274  
   275  ### Debug Mode
   276  
   277  To troubleshoot issues with the `httpcheck` collector, run the `go.d.plugin` with the debug option enabled. The output
   278  should give you clues as to why the collector isn't working.
   279  
   280  - Navigate to the `plugins.d` directory, usually at `/usr/libexec/netdata/plugins.d/`. If that's not the case on
   281    your system, open `netdata.conf` and look for the `plugins` setting under `[directories]`.
   282  
   283    ```bash
   284    cd /usr/libexec/netdata/plugins.d/
   285    ```
   286  
   287  - Switch to the `netdata` user.
   288  
   289    ```bash
   290    sudo -u netdata -s
   291    ```
   292  
   293  - Run the `go.d.plugin` to debug the collector:
   294  
   295    ```bash
   296    ./go.d.plugin -d -m httpcheck
   297    ```
   298  
   299