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

     1  <!--startmeta
     2  custom_edit_url: "https://github.com/netdata/go.d.plugin/edit/master/modules/prometheus/integrations/hasura_graphql_server.md"
     3  meta_yaml: "https://github.com/netdata/go.d.plugin/edit/master/modules/prometheus/metadata.yaml"
     4  sidebar_label: "Hasura GraphQL Server"
     5  learn_status: "Published"
     6  learn_rel_path: "Data Collection/Databases"
     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  # Hasura GraphQL Server
    12  
    13  
    14  <img src="https://netdata.cloud/img/hasura.svg" width="150"/>
    15  
    16  
    17  Plugin: go.d.plugin
    18  Module: prometheus
    19  
    20  <img src="https://img.shields.io/badge/maintained%20by-Community-blue" />
    21  
    22  ## Overview
    23  
    24  Keep tabs on Hasura GraphQL engine metrics for optimized
    25  API performance and management.
    26  
    27  
    28  Metrics are gathered by periodically sending HTTP requests to [Hasura Exporter](https://github.com/zolamk/hasura-exporter).
    29  
    30  
    31  This collector is supported on all platforms.
    32  
    33  This collector supports collecting metrics from multiple instances of this integration, including remote instances.
    34  
    35  
    36  ### Default Behavior
    37  
    38  #### Auto-Detection
    39  
    40  By default, it detects instances running on the local host by trying to connect to known ports that are [allocated to exporters](https://github.com/prometheus/prometheus/wiki/Default-port-allocations).
    41  The full list of endpoints is available in the collector's [configuration file](https://github.com/netdata/go.d.plugin/blob/master/config/go.d/prometheus.conf).
    42  
    43  
    44  #### Limits
    45  
    46  The default configuration for this integration does not impose any limits on data collection.
    47  
    48  #### Performance Impact
    49  
    50  The default configuration for this integration is not expected to impose a significant performance impact on the system.
    51  
    52  
    53  ## Metrics
    54  
    55  This collector has built-in grouping logic based on the [type of metrics](https://prometheus.io/docs/concepts/metric_types/).
    56  
    57  | Metric                    | Chart                                     | Dimension(s)         | Algorithm   |
    58  |---------------------------|-------------------------------------------|----------------------|-------------|
    59  | Gauge                     | for each label set                        | one, the metric name | absolute    |
    60  | Counter                   | for each label set                        | one, the metric name | incremental |
    61  | Summary (quantiles)       | for each label set (excluding 'quantile') | for each quantile    | absolute    |
    62  | Summary (sum and count)   | for each label set                        | the metric name      | incremental |
    63  | Histogram (buckets)       | for each label set (excluding 'le')       | for each bucket      | incremental |
    64  | Histogram (sum and count) | for each label set                        | the metric name      | incremental |
    65  
    66  Untyped metrics (have no '# TYPE') processing:
    67  
    68  - As Counter or Gauge depending on pattern match when 'fallback_type' is used.
    69  - As Counter if it has suffix '_total'.
    70  - As Summary if it has 'quantile' label.
    71  - As Histogram if it has 'le' label.
    72  
    73  **The rest are ignored**.
    74  
    75  
    76  
    77  ## Alerts
    78  
    79  There are no alerts configured by default for this integration.
    80  
    81  
    82  ## Setup
    83  
    84  ### Prerequisites
    85  
    86  #### Install Exporter
    87  
    88  Install [Hasura Exporter](https://github.com/zolamk/hasura-exporter) by following the instructions mentioned in the exporter README.
    89  
    90  
    91  
    92  ### Configuration
    93  
    94  #### File
    95  
    96  The configuration file name for this integration is `go.d/prometheus.conf`.
    97  
    98  
    99  You can edit the configuration file using the `edit-config` script from the
   100  Netdata [config directory](https://github.com/netdata/netdata/blob/master/docs/configure/nodes.md#the-netdata-config-directory).
   101  
   102  ```bash
   103  cd /etc/netdata 2>/dev/null || cd /opt/netdata/etc/netdata
   104  sudo ./edit-config go.d/prometheus.conf
   105  ```
   106  #### Options
   107  
   108  The following options can be defined globally: update_every, autodetection_retry.
   109  
   110  
   111  <details><summary>Config options</summary>
   112  
   113  | Name | Description | Default | Required |
   114  |:----|:-----------|:-------|:--------:|
   115  | update_every | Data collection frequency. | 10 | no |
   116  | autodetection_retry | Recheck interval in seconds. Zero means no recheck will be scheduled. | 0 | no |
   117  | url | Server URL. |  | yes |
   118  | selector | Time series selector (filter). |  | no |
   119  | fallback_type | Time series selector (filter). |  | no |
   120  | max_time_series | Global time series limit. If an endpoint returns number of time series > limit the data is not processed. | 2000 | no |
   121  | max_time_series_per_metric | Time series per metric (metric name) limit. Metrics with number of time series > limit are skipped. | 200 | no |
   122  | timeout | HTTP request timeout. | 10 | 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  ##### selector
   138  
   139  This option allows you to filter out unwanted time series. Only metrics matching the selector will be collected.
   140  
   141  - Logic: (pattern1 OR pattern2) AND !(pattern3 or pattern4)
   142  - Pattern syntax: [selector](https://github.com/netdata/go.d.plugin/blob/master/pkg/prometheus/selector/README.md).
   143  - Option syntax:
   144  
   145  ```yaml
   146  selector:
   147    allow:
   148      - pattern1
   149      - pattern2
   150    deny:
   151      - pattern3
   152      - pattern4
   153  ```
   154  
   155  
   156  ##### fallback_type
   157  
   158  This option allows you to process Untyped metrics as Counter or Gauge instead of ignoring them.
   159  
   160  - Metric name pattern syntax: [shell file name pattern](https://golang.org/pkg/path/filepath/#Match).
   161  - Option syntax:
   162  
   163  ```yaml
   164  fallback_type:
   165    counter:
   166      - metric_name_pattern1
   167      - metric_name_pattern2
   168    gauge:
   169      - metric_name_pattern3
   170      - metric_name_pattern4
   171  ```
   172  
   173  
   174  </details>
   175  
   176  #### Examples
   177  
   178  ##### Basic
   179  
   180  > **Note**: Change the port of the monitored application on which it provides metrics.
   181  
   182  A basic example configuration.
   183  
   184  
   185  ```yaml
   186  jobs:
   187    - name: local
   188      url: http://127.0.0.1:9090/metrics
   189  
   190  ```
   191  ##### Read metrics from a file
   192  
   193  An example configuration to read metrics from a file.
   194  
   195  <details><summary>Config</summary>
   196  
   197  ```yaml
   198  # use "file://" scheme
   199  jobs:
   200    - name: myapp
   201      url: file:///opt/metrics/myapp/metrics.txt
   202  
   203  ```
   204  </details>
   205  
   206  ##### HTTP authentication
   207  
   208  > **Note**: Change the port of the monitored application on which it provides metrics.
   209  
   210  Basic HTTP authentication.
   211  
   212  
   213  <details><summary>Config</summary>
   214  
   215  ```yaml
   216  jobs:
   217    - name: local
   218      url: http://127.0.0.1:9090/metrics
   219      username: username
   220      password: password
   221  
   222  ```
   223  </details>
   224  
   225  ##### HTTPS with self-signed certificate
   226  
   227  > **Note**: Change the port of the monitored application on which it provides metrics.
   228  
   229  Do not validate server certificate chain and hostname.
   230  
   231  
   232  <details><summary>Config</summary>
   233  
   234  ```yaml
   235  jobs:
   236    - name: local
   237      url: https://127.0.0.1:9090/metrics
   238      tls_skip_verify: yes
   239  
   240  ```
   241  </details>
   242  
   243  ##### Multi-instance
   244  
   245  > **Note**: When you define multiple jobs, their names must be unique.
   246  > **Note**: Change the port of the monitored application on which it provides metrics.
   247  
   248  Collecting metrics from local and remote instances.
   249  
   250  
   251  <details><summary>Config</summary>
   252  
   253  ```yaml
   254  jobs:
   255    - name: local
   256      url: http://127.0.0.1:9090/metrics
   257  
   258    - name: remote
   259      url: http://192.0.2.1:9090/metrics
   260  
   261  ```
   262  </details>
   263  
   264  
   265  
   266  ## Troubleshooting
   267  
   268  ### Debug Mode
   269  
   270  To troubleshoot issues with the `prometheus` collector, run the `go.d.plugin` with the debug option enabled. The output
   271  should give you clues as to why the collector isn't working.
   272  
   273  - Navigate to the `plugins.d` directory, usually at `/usr/libexec/netdata/plugins.d/`. If that's not the case on
   274    your system, open `netdata.conf` and look for the `plugins` setting under `[directories]`.
   275  
   276    ```bash
   277    cd /usr/libexec/netdata/plugins.d/
   278    ```
   279  
   280  - Switch to the `netdata` user.
   281  
   282    ```bash
   283    sudo -u netdata -s
   284    ```
   285  
   286  - Run the `go.d.plugin` to debug the collector:
   287  
   288    ```bash
   289    ./go.d.plugin -d -m prometheus
   290    ```
   291  
   292