-
Notifications
You must be signed in to change notification settings - Fork 1
Plugin Implementation
The Prometheus Monitoring Plugin was implemented using the Open Baton Monitoring Plugin SDK. The SDK enabled this plugin to be easily integrated with Open Baton.
The Prometheus Monitoring Plugin has three main classes:
The Prometheus Sender class is the class, which connects the plugin to the Prometheus Server. It has the following structure:
- Constructor - The Constructor of this creates an instance by specifying the IP and port of the Prometheus server.
- Instant Query - The Instant query function queries data from the Prometheus Server. It is not used in the Plugin Agent, but is implemented because in the future it might be useful.
- Range Query - The Range query function queries data for a specific period and step. The period is where the time slot starts and the end of the time slot is the current time. The step is specified in seconds and represents in what steps does the data have to be represented.
This class is an HTTP Handler, which provides the functionality for adding a new target to monitor to the Node Exporter Job. This is meant to be part of the integration with the Auto Scaling Engine in the following way - once the Generic VNFM launches a VNFC it starts the user-data script, providing also the functionality for starting a Node Exporter instance on it. This means that once the target is registered on the Prometheus Server it is ready to be monitored. This HTTP Handler provides exactly this functionality for registering a new target. The prerequisite is that the Plugin has access to the configuration file of the Prometheus Server. If this is fulfilled then the new target can be added just by sending for example the following request:
curl -X POST -H "Content-Type: application/json" -d '{"jobName":"node", "ip":"10.120.30.10", "port":"9100"}' localhost:8010/notifications
Above it was already mentioned, that the node exporter launch script needs to be part of the user-data script. The node exporter launch script can be found here.
This class is implemented using the Open Baton Monitoring Plugin SDK.
The only fully implemented function is Querying a PM job. The work done on other functions will be discussed in the Future Work section.
The Query PM Job function is used by the Auto Scaling Engine for retrieving information for metrics of Virtual Network Function Components. The Inputs are a list of host names, a list of metrics and a period. The metrics and period are passed directly to the Prometheus Sender and are used as explained above. The Prometheus Sender returns a list of the result for each metric and for each host currently monitored by the Prometheus Server. Therefore the function itself filters out only the hosts that are of interest to the Auto Scaling Engine and returns the information as a list of the class Item, which is used in the Auto Scaling Engine.