def subscribe(self, callback, filter_):
sub_id = "<STR_LIT>".format(uuid=uuid.uuid4())<EOL>sub = pd.DataFrame({sub_id: filter_}).T<EOL>sub['<STR_LIT>'] = callback<EOL>self.subscribers = self.subscribers.append(sub)<EOL>this_subscriber_metrics = self.__filter(self.metrics_meta, filter_)<EOL>if this_subscriber_metrics.empty:<EOL><INDENT>logger.debug('<STR_LIT>', sub_id)<EOL><DEDENT>else:<EOL><INDENT>logger.debug('<STR_LIT>', this_subscriber_metrics)<EOL>this_subscriber_metrics['<STR_LIT>'] = callback<EOL>prepared_callbacks = this_subscriber_metrics[['<STR_LIT>']]<EOL>self.callbacks = self.callbacks.append(prepared_callbacks)<EOL><DEDENT>
Create and register metric subscriber,
find metrics for this subscriber (using filter_) and subscribe

Args:
    callback (object method): subscriber's callback
    filter_ (dict): filter dict

filter sample:
    {'type': 'metrics', 'source': 'gun'}