github.com/observiq/bindplane-agent@v1.51.0/config/google_cloud_exporter/prometheus/README.md (about)

     1  # Prometheus Metrics with Google Cloud
     2  
     3  The Prometheus Receiver can be used to send prometheus style metrics scraped from prometheus exporters to Google Cloud Monitoring.
     4  
     5  ## Prerequisites
     6  
     7  See the [prerequisites](../README.md) doc for Google Cloud prerequisites.
     8  
     9  Ensure your applications support prometheus metrics, or have prometheus exporters configured.
    10  
    11  ## Usage
    12  
    13  Modify the example configuration's `prometheus` receiver. Update
    14  the `job_name` value to reflect your environment. Also update the
    15  `targets` value(s) to point to your application's prometheus exporter(s).
    16  
    17  For example, if you have five Nginx systems that need to be
    18  monitored, your receiver configuration would look like this:
    19  
    20  ```yaml
    21  receivers:
    22    prometheus:
    23      config:
    24        scrape_configs:
    25        - job_name: 'nginx'
    26          scrape_interval: 60s
    27          static_configs:
    28          - targets:
    29            - 'nginx-0:9113'
    30            - 'nginx-1:9113'
    31            - 'nginx-2:9113'
    32            - 'nginx-3:9113'
    33            - 'nginx-4:9113'
    34  ```
    35  
    36  You can have multiple scrape configs, for targeting multiple applications.
    37  
    38  ```yaml
    39  receivers:
    40    prometheus:
    41      config:
    42        scrape_configs:
    43        - job_name: 'nginx'
    44          scrape_interval: 60s
    45          static_configs:
    46          - targets:
    47            - 'nginx-0:9113'
    48        - job_name: 'redis'
    49          scrape_interval: 60s
    50          static_configs:
    51          - targets:
    52            - 'redis-0:9900'
    53  ```
    54  
    55  ### Deploy
    56  
    57  1. Copy [config.yaml](./config.yaml) to `/opt/observiq-otel-collector/config.yaml`
    58  2. Modify the configuration to reflect your environment (See [Usage](./README.md#usage))
    59  3. Restart the agent: `sudo systemctl restart observiq-otel-collector`
    60  
    61  You can search for metrics under the "Generic Node" section
    62  with the prefix `workload.googleapis.com`.
    63  
    64  ### Metric Labels
    65  
    66  | Label       | Description | Example |
    67  | ----------- | ----------- | ------- |
    68  | `node_id`   | The hostname of the agent. Set within the [Google exporter](https://github.com/observIQ/bindplane-agent/tree/main/exporter/googlecloudexporter#metric-processing-steps), and required for [generic_node](https://cloud.google.com/monitoring/api/resources#tag_generic_node) monitored resource type. | `collector-0` |
    69  | `job` | Dervied from the Prometheus receiver's `config.scrape_configs` `job_name` value. This value should represent the applications being scraped by the scrape config. | `nodeexporter` |
    70  | `instance` | The host / ip and port being scraped by the scrape config. | `node-1:9100` |
    71  
    72  For the best experience, ensure that the values for `job_name` and `targets` are descriptive, as the
    73  `job` and `instance` metric labels are derived from those values.
    74  
    75  ### Custom Metric Prefix
    76  
    77  Generally metric names will contain their software name, however, sometimes
    78  you might have a metric that is not descriptive, such as `uptime`. In this case, you
    79  can use a custom metric prefix.
    80  
    81  ```yaml
    82  exporters: 
    83    googlecloud/mycustomapp:
    84      metric:
    85        prefix: workload.googleapis.com/mycustomapp
    86  ...
    87  service:
    88    pipelines:
    89      metrics:
    90        ...
    91        exporters:
    92        - googlecloud/mycustomapp
    93  ```
    94  
    95  This configuration snipet contains a Google exporter dedicated to `mycustomapp`, which
    96  has a metric prefix of `workload.googleapis.com/mycustomapp`.
    97  
    98  
    99  
   100