Help us improve your experience.

Let us know what you think.

Do you have time for a two-minute survey?


Contrail Insights Object Plug-In


Object scope plug-in is supported to extend the instance and host scope plug-in. It will assign an aggregate of hosts running a plug-in script to collect data for an aggregate of objects (such as instances). Currently, only an aggregate of instances can be monitored and only the plug-in type is supported.

The collector failover High Availability (HA) feature is supported in object scope plug-ins. If one of the collectors in the aggregate is down, Contrail Insights will automatically assign another host in the same aggregate as the collector. As a result, you can set up an aggregate of several collectors which will make sure downtime of some of the collectors will not affect the object monitoring.

Create an Object Scope Plug-In

To add an object scope plug-in in Contrail Insights, you need to supply both a plug-in script and plug-in JSON file. Contrail Insights Agent will pass a list of object_ids separated by commas (-o) and a dictionary to MetaData (-p) to the plug-in script. The Contrail Insights Agent expects the plug-in script to return data with the following format:

The main body of the data should be a list of dictionaries and each entry should represent a data point with all of the metrics for one instance.

Following is an example of a plug-in script which will get instance data from some endpoint, passed in from the MetaData variable.

Following is the corresponding flask server running on localhost:9999 for the above example:

For example, if you want to get data for instances fd5977d4-150d-4af4-bfaf-96663902447e and a53a441b-fb1f-4e08-9e05-d94fd4d5a0ba with URL http://localhost:9999 (because your server is running on localhost port 9999), you can run the following command:

The output of the command is:

The corresponding plug-in JSON file will be:

Where ObjectAggregateId should be the aggregate identifier of the aggregate of instances you want to monitor and AggregateId should be the aggregate identifier of the host aggregate which is assigned to collect the data for the instances.

Note that you can put additional information in the MetaData field in the plug-in as needed. The above example is just a simple example.

Add Object Scope Plug-In to Contrail Insights

To add the object scope plug-in to Contrail Insights, you need to post your plug-in to Contrail Insights through Ansible. Add the following lines in your Ansible group_vars/all file and re-run the Ansible playbook.

The Contrail Insights Ansible playbooks will then copy these two types of files to all of the appropriate Agents and then configure the plug-in in the Contrail Insights Platform.