Commit 9d83f3d9 authored by vegall's avatar vegall
Browse files

Adds documentation about How to Monitor the NS deployed using Prometheus



Signed-off-by: default avatarvegall <lvega@whitestack.com>
parent c2a0511a
Loading
Loading
Loading
Loading
Loading
+42 −0
Original line number Diff line number Diff line
@@ -113,6 +113,48 @@ With respect to a regular Openstack, these additional configuration parameteres

For common options, you may refer to the general OpenStack Setup Guide.

#### How to Monitor the NS deployed using Prometheus

If you want to monitor the VMs deployed in an OpenStack using Prometheus, you first need to deploy the VIM with the specific option:

```bash
osm vim-create --name <vim-name> --user <user> --password <password> --auth_url <openstack-url> --tenant <tenant> --account_type openstack --prometheus_config_file <prometheus_config_file.json>
```

Where the `<prometheus_config_file.json>` has the following format:

```json
{
  "prometheus-url": "http://<prometheus-pushgateway-url>:9090",
  "prometheus_cred": {},
  "prometheus_map": {
    "cpu_utilization": "cpu",
    "average_memory_utilization": "memory_usage",
    "disk_read_ops": "disk_device_read_requests",
    "disk_write_ops": "disk_device_write_requests",
    "disk_read_bytes": "disk_device_read_bytes",
    "disk_write_bytes": "disk_device_write_bytes",
    "packets_in_dropped": "network_incoming_packets_drop",
    "packets_out_dropped": "network_outgoing_packets_drop",
    "packets_received": "network_incoming_packets",
    "packets_sent":"network_outgoing_packets"
  }
}
```

Then, check `mon` to see the logs:

```bash
02/29/2024 05:08:34 PM - osm_mon.collector.vnf_collectors.juju - INFO - N2VC juju connector initialized
02/29/2024 05:08:34 PM - osm_mon.collector.vnf_collectors.openstack - INFO - Collecting metric type: MetricType.INSTANCE and metric_name: cpu_utilization and resource_id 8778d4ad-f8ce-4d51-8216-726ea5a36dbe and 
02/29/2024 05:08:34 PM - db - INFO - Connected to database osm version 1.2
02/29/2024 05:08:34 PM - db - INFO - Connected to database osm version 1.2
02/29/2024 05:08:34 PM - db - INFO - Connected to database osm version 1.2
02/29/2024 05:08:34 PM - osm_mon.collector.vnf_collectors.openstack - INFO - value: 18530000000
02/29/2024 05:08:34 PM - osm_mon.collector.vnf_collectors.openstack - INFO - Using an <class 'osm_mon.collector.vnf_collectors.openstack.PrometheusTSBDBackend'> as backend
02/29/2024 05:08:34 PM - osm_mon.collector.vnf_collectors.openstack - INFO - Collecting metric type: MetricType.INSTANCE and metric_name: average_memory_utilization and resource_id 8778d4ad-f8ce-4d51-8216-726ea5a36dbe and
```

## OpenVIM (Deprecated)

### How to set up an OpenVIM environment