The Complete custom rest collector process with sample code.

To write custom collector, need to implement Batch Collector and override the definitions provided such as below:

1.    Collect – collect data from rest end point

2.   Transform – transform collected data into metric

Later, the transformed data publishes to Kafka bus for further processing

class RestCollector(BatchCollector):
    def __init__(self, logger, config: dict) -> None:    
        self._config = config    
        super(BatchCollector, self).__init__(logger, config)
    def collect(self):               
        # write logic to collect data from end points using RestClinet
    def transform(self):               
        # transform the collected data to metric