File tree 1 file changed +16
-1
lines changed 1 file changed +16
-1
lines changed Original file line number Diff line number Diff line change @@ -167,6 +167,21 @@ fn health_check_port_etcd(port: u16) -> HealthCheck {
167
167
}
168
168
}
169
169
170
+ fn health_check_port_prometheus ( port : u16 ) -> HealthCheck {
171
+ HealthCheck {
172
+ test : vec ! [
173
+ "CMD-SHELL" . into( ) ,
174
+ format!(
175
+ "sh -c 'printf \" GET /-/healthy HTTP/1.0\\ n\\ n\" | nc localhost {}; exit $?;'" ,
176
+ port
177
+ ) ,
178
+ ] ,
179
+ interval : "1s" . to_string ( ) ,
180
+ timeout : "5s" . to_string ( ) ,
181
+ retries : 5 ,
182
+ }
183
+ }
184
+
170
185
impl Compose for ComputeNodeConfig {
171
186
fn compose ( & self , config : & ComposeConfig ) -> Result < ComposeService > {
172
187
let mut command = Command :: new ( "compute-node" ) ;
@@ -416,7 +431,7 @@ impl Compose for PrometheusConfig {
416
431
expose : vec ! [ self . port. to_string( ) ] ,
417
432
ports : vec ! [ format!( "{}:{}" , self . port, self . port) ] ,
418
433
volumes : vec ! [ format!( "{}:/prometheus" , self . id) ] ,
419
- healthcheck : Some ( health_check_port ( self . port ) ) ,
434
+ healthcheck : Some ( health_check_port_prometheus ( self . port ) ) ,
420
435
..Default :: default ( )
421
436
} ;
422
437
You can’t perform that action at this time.
0 commit comments