diff --git a/kaneda/backends/elasticsearch.py b/kaneda/backends/elasticsearch.py index f480775..763cd28 100644 --- a/kaneda/backends/elasticsearch.py +++ b/kaneda/backends/elasticsearch.py @@ -56,7 +56,7 @@ def _get_index_name(self): def report(self, name, metric, value, tags, id_): payload = self._get_payload(name, value, tags) try: - self.client.index(index=self._get_index_name(), doc_type=metric, id=id_, body=payload) + return self.client.index(index=self._get_index_name(), doc_type=metric, id=id_, body=payload) except Exception as e: logger = logging.getLogger(__name__) logger.exception(e) diff --git a/kaneda/backends/logger.py b/kaneda/backends/logger.py index 796bd41..482dabe 100644 --- a/kaneda/backends/logger.py +++ b/kaneda/backends/logger.py @@ -36,5 +36,5 @@ def _get_payload(self, name, value, metric, tags, id_): def report(self, name, metric, value, tags, id_): payload = self._get_payload(name, value, metric, tags, id_) - self.logger.info(payload) + return self.logger.info(payload) diff --git a/kaneda/backends/mongodb.py b/kaneda/backends/mongodb.py index 63d2704..033444c 100644 --- a/kaneda/backends/mongodb.py +++ b/kaneda/backends/mongodb.py @@ -50,7 +50,7 @@ def _get_payload(self, name, value, metric, tags, id_): def report(self, name, metric, value, tags, id_): payload = self._get_payload(name, value, metric, tags, id_) try: - self.collection.insert_one(payload) + return self.collection.insert_one(payload) except Exception as e: logger = logging.getLogger(__name__) logger.exception(e) diff --git a/kaneda/base.py b/kaneda/base.py index 7b6a1ee..6fc124e 100644 --- a/kaneda/base.py +++ b/kaneda/base.py @@ -115,4 +115,4 @@ def get_user(user_id): return self._TimedContextManagerDecorator(self, name, tags, use_ms) def _report(self, name, metric, value, tags, id_=None): - self.backend.report(name, metric, value, tags, id_) + return self.backend.report(name, metric, value, tags, id_)