Skip to content

Commit 7193619

Browse files
committed
update prometheus compose port
1 parent cadd4c9 commit 7193619

File tree

1 file changed

+16
-1
lines changed

1 file changed

+16
-1
lines changed

src/risedevtool/src/compose.rs

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -167,6 +167,21 @@ fn health_check_port_etcd(port: u16) -> HealthCheck {
167167
}
168168
}
169169

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+
170185
impl Compose for ComputeNodeConfig {
171186
fn compose(&self, config: &ComposeConfig) -> Result<ComposeService> {
172187
let mut command = Command::new("compute-node");
@@ -416,7 +431,7 @@ impl Compose for PrometheusConfig {
416431
expose: vec![self.port.to_string()],
417432
ports: vec![format!("{}:{}", self.port, self.port)],
418433
volumes: vec![format!("{}:/prometheus", self.id)],
419-
healthcheck: Some(health_check_port(self.port)),
434+
healthcheck: Some(health_check_port_prometheus(self.port)),
420435
..Default::default()
421436
};
422437

0 commit comments

Comments
 (0)