diff --git a/config/demo-trace/main.go b/config/demo-trace/main.go index 9074346..3e3c7fd 100644 --- a/config/demo-trace/main.go +++ b/config/demo-trace/main.go @@ -166,5 +166,18 @@ func main() { } span.End() time.Sleep(5 * time.Second) - } + // Health check endpoint + http.HandleFunc("/health", func(w http.ResponseWriter, r *http.Request) { + w.WriteHeader(http.StatusOK) + fmt.Fprintln(w, "OK") + }) + + // Application logic + http.HandleFunc("/", func(w http.ResponseWriter, r *http.Request) { + fmt.Fprintln(w, "Hello, World!") + }) + + // Start server + http.ListenAndServe(":57400", nil) + } } diff --git a/docker-compose.yml b/docker-compose.yml index aa937bf..bb16074 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -159,6 +159,12 @@ services: - spdk networks: - opi + healthcheck: + test: wget --no-verbose --tries=1 --spider http://localhost:57400/health + interval: 10s + timeout: 10s + retries: 5 + jaeger-all-in-one: image: jaegertracing/all-in-one:latest @@ -169,7 +175,12 @@ services: - "14250" networks: - opi - + healthcheck: + test: wget --no-verbose --tries=1 --spider http://localhost:16686 || exit 1 + interval: 6s + timeout: 10s + retries: 5 + volumes: influxdb-storage: