@@ -13,7 +13,18 @@ def try_get(url):
1313 retries = 3
1414 for i in range (retries ):
1515 try :
16- r = requests .get (url , timeout = 5 , auth = ("trino" , "" ))
16+ if "coordinator" in url :
17+ r = requests .get (
18+ url ,
19+ timeout = 5 ,
20+ headers = {"x-trino-user" : "admin" },
21+ auth = ("admin" , "admin" ),
22+ verify = False ,
23+ )
24+ else :
25+ r = requests .get (
26+ url , timeout = 5 , headers = {"x-trino-user" : "admin" }, verify = False
27+ )
1728 r .raise_for_status ()
1829 return r
1930 except requests .exceptions .HTTPError as errh :
@@ -31,17 +42,15 @@ def try_get(url):
3142def check_monitoring (hosts ):
3243 for host in hosts :
3344 # test for the jmx exporter metrics
34- url = host + ":8081"
45+ url = "http://" + host + ":8081/metrics "
3546 response = try_get (url )
3647
37- if response .ok :
38- continue
39- else :
48+ if not response .ok :
4049 print ("Error for [" + url + "]: could not access monitoring" )
4150 exit (- 1 )
4251
4352 # test for the native metrics
44- url = host + ":8443/metrics"
53+ url = "https://" + host + ":8443/metrics"
4554 response = try_get (url )
4655
4756 if response .ok :
@@ -51,7 +60,6 @@ def check_monitoring(hosts):
5160 else :
5261 print ("Error for [" + url + "]: missing metrics" )
5362 exit (- 1 )
54- continue
5563 else :
5664 print ("Error for [" + url + "]: could not access monitoring" )
5765 exit (- 1 )
@@ -65,8 +73,10 @@ def check_monitoring(hosts):
6573 args = vars (all_args .parse_args ())
6674 namespace = args ["namespace" ]
6775
68- host_coordinator_0 = f"http://trino-coordinator-default-0.trino-coordinator-default.{ namespace } .svc.cluster.local"
69- host_worker_0 = f"http://trino-worker-default-0.trino-worker-default.{ namespace } .svc.cluster.local"
76+ host_coordinator_0 = f"trino-coordinator-default-0.trino-coordinator-default.{ namespace } .svc.cluster.local"
77+ host_worker_0 = (
78+ f"trino-worker-default-0.trino-worker-default.{ namespace } .svc.cluster.local"
79+ )
7080
7181 hosts = [host_coordinator_0 , host_worker_0 ]
7282
0 commit comments