diff --git a/src/robusta/core/sinks/robusta/prometheus_discovery_utils.py b/src/robusta/core/sinks/robusta/prometheus_discovery_utils.py index 897e548fb..db6305695 100644 --- a/src/robusta/core/sinks/robusta/prometheus_discovery_utils.py +++ b/src/robusta/core/sinks/robusta/prometheus_discovery_utils.py @@ -73,7 +73,7 @@ def _get_query_prometheus_value(self, query: str) -> Optional[float]: value = query_result.vector_result[0]["value"]["value"] return_value = float("%.2f" % float(value)) return return_value if return_value >= 0 else None - except: + except Exception: logging.exception("PrometheusDiscoveryUtils failed to get prometheus results.") return diff --git a/src/robusta/core/sinks/transformer.py b/src/robusta/core/sinks/transformer.py index 7d2daeb8c..ce7efd041 100644 --- a/src/robusta/core/sinks/transformer.py +++ b/src/robusta/core/sinks/transformer.py @@ -87,7 +87,7 @@ def trim_markdown(text: str, max_length: int, suffix: str = "...") -> str: def apply_length_limit_to_markdown(msg: str, max_length: int, truncator: str = "...") -> str: try: return Transformer.trim_markdown(msg, max_length, truncator) - except: + except Exception: return Transformer.apply_length_limit(msg, max_length, truncator) @staticmethod diff --git a/src/robusta/integrations/prometheus/models.py b/src/robusta/integrations/prometheus/models.py index 8d07e48e4..3b288b233 100644 --- a/src/robusta/integrations/prometheus/models.py +++ b/src/robusta/integrations/prometheus/models.py @@ -39,7 +39,7 @@ def update_severity_map(global_config): custom_severity_map = global_config.get("custom_severity_map", {}) for key in custom_severity_map.keys(): SEVERITY_MAP[key] = FindingSeverity.from_severity(custom_severity_map[key].upper()) - except: + except Exception: logging.exception("Failed to map custom severities")