You can use the REST Api from Spark. Documentation: https://spark.apache.org/docs/latest/monitoring.html#rest-api
Here's an example:
http://localhost:4040/api/v1?status=running
Note: For the history server, they would typically be accessible at http://localhost:18080/api/v1
and for a running application, at http://localhost:4040/api/v1
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…