Monitoring UFT Mobile with Prometheus and Grafana

Screen Shot 2020-01-13 at 16.07.37.png

 

UFT Mobile have build-in integration with Prometheus for monitoring purposes.

The following guide will help you to configure Prometheus to scrape metrics that UFTM is exposing.

Mobile Connectors can report metrics to the UFTM Server and Prometheus can be configured to scrape those metrics.

  • Enable Mobile Connectors to report metrics to Prometheus: edit configuration file metrics-config.properties (located at /connector/conf folder) and modify the following line: 

 

METRICS_PROMETHEUS_ENABLE=true

 

  • Restart the connector service.

  • Enable UFTM Server to expose metrics to Prometheus: edit setEnv.sh configuration file for linux user (located at /home/<user> directory) 

 

export METRICS_PROMETHEUS_ENABLE=true

 

For Windows system define system environment variable 

 

 

- job_name: 'mc_console' scrape_interval: 5s metrics_path: /rest/prometheus static_configs: - targets: ['<UFTM SERVER HOST>:<UFTM SERVER PORT>']

 

 

Optional: if embedded connector is used, please add the following to the prometheus.yaml

 

 

- job_name: 'mc_embedded_connector' scrape_interval: 5s scheme: <http/https> metrics_path: /hp4m-connector/rest/prometheus static_configs: - targets: ['<UFTM SERVER HOST>:<UFTM SERVER PORT>']

 

 

  • Restart Prometheus
  • Verify that scrape working: navigate to http://<PROMETHEUS HOST>:9090 and verify metric of "scrape_samples_scraped" - you should receive the data about job mc_console
  • Install Grafana as visualization layer and configure it to work with Prometheus (see https://logz.io/blog/prometheus-monitoring/)

Few screenshots are attached for your convenience.

The following metrics are available (example):

  1. mc_connector: device connectivity gauge (1 - connected, 0 - disconnected)
  2. mc_connector: device wifi connectivity gauge
  3. mc_connector: vnc_enabled (actively open remote view on the device)
  4. mc_console: login_succeded (login to the tool)
  5. mc_console: reservation_succeded (create reservation for the device)   

Please free to share your ideas about what metrics should be exposed there!

Also, there is additional metrics reporting using CSV files and statsD daemon (but I'll keep it for a different post).

Enjoy!