This is an automated email from the ASF dual-hosted git repository.

villebro pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/superset.git


The following commit(s) were added to refs/heads/master by this push:
     new 13a186bdc2 chore(logging): add health checks to statsd (#22771)
13a186bdc2 is described below

commit 13a186bdc26a004a20eeb832dd35eff459893793
Author: Ville Brofeldt <[email protected]>
AuthorDate: Fri Jan 20 13:21:36 2023 +0200

    chore(logging): add health checks to statsd (#22771)
---
 superset/views/health.py | 17 +++++------------
 1 file changed, 5 insertions(+), 12 deletions(-)

diff --git a/superset/views/health.py b/superset/views/health.py
index cf85b89278..8b082ff88f 100644
--- a/superset/views/health.py
+++ b/superset/views/health.py
@@ -15,22 +15,15 @@
 # specific language governing permissions and limitations
 # under the License.
 from superset import app, talisman
+from superset.stats_logger import BaseStatsLogger
 from superset.superset_typing import FlaskResponse
 
 
-@talisman(force_https=False)
[email protected]("/ping")
-def ping() -> FlaskResponse:
-    return "OK"
-
-
-@talisman(force_https=False)
[email protected]("/healthcheck")
-def healthcheck() -> FlaskResponse:
-    return "OK"
-
-
 @talisman(force_https=False)
 @app.route("/health")
[email protected]("/healthcheck")
[email protected]("/ping")
 def health() -> FlaskResponse:
+    stats_logger: BaseStatsLogger = app.config["STATS_LOGGER"]
+    stats_logger.incr("health")
     return "OK"

Reply via email to