mirror of
https://github.com/apache/superset.git
synced 2026-04-25 11:04:48 +00:00
chore: increment statsd as warn (#23041)
This commit is contained in:
committed by
GitHub
parent
92b9c06e59
commit
434b445e31
@@ -45,7 +45,17 @@ def statsd_gauge(metric_prefix: Optional[str] = None) -> Callable[..., Any]:
|
||||
current_app.config["STATS_LOGGER"].gauge(f"{metric_prefix_}.ok", 1)
|
||||
return result
|
||||
except Exception as ex:
|
||||
current_app.config["STATS_LOGGER"].gauge(f"{metric_prefix_}.error", 1)
|
||||
if (
|
||||
hasattr(ex, "status")
|
||||
and ex.status < 500 # type: ignore # pylint: disable=no-member
|
||||
):
|
||||
current_app.config["STATS_LOGGER"].gauge(
|
||||
f"{metric_prefix_}.warning", 1
|
||||
)
|
||||
else:
|
||||
current_app.config["STATS_LOGGER"].gauge(
|
||||
f"{metric_prefix_}.error", 1
|
||||
)
|
||||
raise ex
|
||||
|
||||
return wrapped
|
||||
|
||||
Reference in New Issue
Block a user