Refactor the code

Multiple code refactorings to make the code
simpler and increase the unit testing coverage.

* Golint findings are fixed.
* Xapp query function name changed from status to
  config.

The functionality is slightly changed so that
  - Vespa is started only after the xapp notification
    subscription is successful and the vesmgr has received
    the current xapp configuration from the xapp manager.
  - The vesmgr goes to the main loop after that.

Change-Id: Ie2675c0543d4e4ce0a60b92a6c06a79b9e2cb2cd
Signed-off-by: Roni Riska <roni.riska@nokia.com>
13 files changed
tree: 17cbb5ff676938e7dc5411bbe5b387d59c79f7da
  1. cmd/
  2. test/
  3. ves-agent-chart/
  4. .gitreview
  5. container-tag.yaml
  6. Dockerfile
  7. go.mod
  8. go.sum
  9. LICENSES.txt
  10. README.md
README.md

RIC VESPA manager

The VESPA manager uses the VES Agent (https://github.com/nokia/ONAP-VESPA) to adapt near-RT RIC internal statistics' collection using Prometheus (xApps and platform containers) to ONAP's VES (VNF event streaming).

The vesmgr container runs two processes: the VESPA manager and the VES Agent (i.s. VESPA).

The VESPA manager starts and configures the VES Agent.

The VES Agent is a service acting as a bridge between Prometheus and ONAP's VES Collector.

Application metrics definition

The application metrics are defined in the application descriptor. For each counter, the following fields are required in the "metrics" section of the descriptor:

  • name - Prometheus name of the counter
  • objectName - object name in VES
  • objectInstance - object instance in VE

The VESPA manager receives the application metrics configuration from the application manager. It subscribes the app notification messages from the application manager, and after having received one, requests the latest application configuration, creates the VES Agent configuration based on it, and restarts the VES Agent.

The VES Agent does not report any other metrics to VES.

Prometheus configuration

The VES Agent reads the ricComponentName from Prometheus label "kubernetes_name".

VES Collector event format

The VES Agent transmits events to the VES Collector in the VES Common Event Format v5.4.1. The Common Event Format is expressed in JSON schema v28.4.1.

VES Event Listener 5.4.1: https://docs.onap.org/en/casablanca/submodules/vnfsdk/model.git/docs/files/VESEventListener.html

JSON schema v28.4.1: https://github.com/nokia/ONAP-VESPA/blob/8e9d9e93bb00bed0f5402c9de9502385d5e80acc/doc/CommonEventFormat_28.4.1.json

Environment variables

The VESPA manager container requires the following environment variables:

  • VESMGR_HB_INTERVAL - VES heartbeat interval as a string. For example: 30s.

  • VESMGR_MEAS_INTERVAL - Measurement interval as a string. For example: 60s.

  • VESMGR_PROMETHEUS_ADDR - Prometheus address. For example: http://127.0.0.1:123

  • VESMGR_PRICOLLECTOR_ADDR - Primary collector FQDN as a string. For example: ricaux-entry.

  • VESMGR_PRICOLLECTOR_PORT - Primary collector port id as an integer. Default: 8443.

  • VESMGR_PRICOLLECTOR_SERVERROOT - Path before the /eventListener part of the POST URL as a string.

  • VESMGR_PRICOLLECTOR_TOPIC - Primary collector topic as a string.

  • VESMGR_PRICOLLECTOR_SECURE - Use HTTPS for VES collector. Possible string values: true or false.

  • VESMGR_PRICOLLECTOR_USER - User name as a string.

  • VESMGR_PRICOLLECTOR_PASSWORD - Password as a string.

  • VESMGR_PRICOLLECTOR_PASSPHASE - Passphrase as a string.

  • VESMGR_APPMGRDOMAIN - Application manager domain. This is for testing purposes, only. Default: service-ricplt-appmgr-http.ricplt.svc.cluster.local.

Liveness probe

The VESPA manager replies to liveness HTTP GET at path /supervision.

Unit Tests

In order to run the VESPA manager unit tests, give the following command:

go test ./... -v

License

See LICENSES.txt file.