@@ -417,8 +417,8 @@ class Dash(ObsoleteChecker):
417417 they will be responsible for installing the `flask[async]` dependency.
418418 :type use_async: boolean
419419
420- :param health_endpoint: Path for the health check endpoint. Set to None to
421- disable the health endpoint. Default is "health" .
420+ :param health_endpoint: Path for the health check endpoint. Set to None to
421+ disable the health endpoint. Default is None .
422422 :type health_endpoint: string or None
423423 """
424424
@@ -470,7 +470,7 @@ def __init__( # pylint: disable=too-many-statements
470470 description : Optional [str ] = None ,
471471 on_error : Optional [Callable [[Exception ], Any ]] = None ,
472472 use_async : Optional [bool ] = None ,
473- health_endpoint : Optional [str ] = "health" ,
473+ health_endpoint : Optional [str ] = None ,
474474 ** obsolete ,
475475 ):
476476
@@ -986,66 +986,9 @@ def serve_reload_hash(self):
986986 def serve_health (self ):
987987 """
988988 Health check endpoint for monitoring Dash server status.
989-
990- Returns a JSON response indicating the server is running and healthy.
991- This endpoint can be used by load balancers, monitoring systems,
992- and other platforms to check if the Dash server is operational.
993-
994- :return: JSON response with status information
989+ Returns a simple "OK" response with HTTP 200 status.
995990 """
996- import datetime
997- import platform
998- import psutil
999- import sys
1000-
1001- # Basic health information
1002- health_data = {
1003- "status" : "healthy" ,
1004- "timestamp" : datetime .datetime .utcnow ().isoformat () + "Z" ,
1005- "dash_version" : __version__ ,
1006- "python_version" : sys .version ,
1007- "platform" : platform .platform (),
1008- }
1009-
1010- # Add server information if available
1011- try :
1012- health_data .update ({
1013- "server_name" : self .server .name ,
1014- "debug_mode" : self .server .debug ,
1015- "host" : getattr (self .server , 'host' , 'unknown' ),
1016- "port" : getattr (self .server , 'port' , 'unknown' ),
1017- })
1018- except Exception :
1019- pass
1020-
1021- # Add system resource information if psutil is available
1022- try :
1023- health_data .update ({
1024- "system" : {
1025- "cpu_percent" : psutil .cpu_percent (interval = 0.1 ),
1026- "memory_percent" : psutil .virtual_memory ().percent ,
1027- "disk_percent" : psutil .disk_usage ('/' ).percent if os .name != 'nt' else psutil .disk_usage ('C:' ).percent ,
1028- }
1029- })
1030- except ImportError :
1031- # psutil not available, skip system metrics
1032- pass
1033- except Exception :
1034- # Error getting system metrics, skip them
1035- pass
1036-
1037- # Add callback information
1038- try :
1039- health_data .update ({
1040- "callbacks" : {
1041- "total_callbacks" : len (self .callback_map ),
1042- "background_callbacks" : len (getattr (self , '_background_callback_map' , {})),
1043- }
1044- })
1045- except Exception :
1046- pass
1047-
1048- return flask .jsonify (health_data )
991+ return flask .Response ("OK" , status = 200 , mimetype = "text/plain" )
1049992
1050993 def get_dist (self , libraries : Sequence [str ]) -> list :
1051994 dists = []
0 commit comments