diff options
Diffstat (limited to 'osprofiler/drivers/base.py')
-rw-r--r-- | osprofiler/drivers/base.py | 19 |
1 files changed, 18 insertions, 1 deletions
diff --git a/osprofiler/drivers/base.py b/osprofiler/drivers/base.py index 94d40d5..6583a88 100644 --- a/osprofiler/drivers/base.py +++ b/osprofiler/drivers/base.py @@ -55,7 +55,8 @@ class Driver(object): default_trace_fields = {"base_id", "timestamp"} - def __init__(self, connection_str, project=None, service=None, host=None): + def __init__(self, connection_str, project=None, service=None, host=None, + **kwargs): self.connection_str = connection_str self.project = project self.service = service @@ -66,6 +67,12 @@ class Driver(object): # Last trace started time self.last_started_at = None + profiler_config = kwargs.get("conf", {}).get("profiler", {}) + if hasattr(profiler_config, "filter_error_trace"): + self.filter_error_trace = profiler_config.filter_error_trace + else: + self.filter_error_trace = False + def notify(self, info, **kwargs): """This method will be called on each notifier.notify() call. @@ -115,6 +122,16 @@ class Driver(object): "or has to be overridden".format( self.get_name())) + def list_error_traces(self): + """Query all error traces from the storage. + + :return List of traces, where each trace is a dictionary containing + `base_id` and `timestamp`. + """ + raise NotImplementedError("{0}: This method is either not supported " + "or has to be overridden".format( + self.get_name())) + @staticmethod def _build_tree(nodes): """Builds the tree (forest) data structure based on the list of nodes. |