Skip to content

Conversation

Copy link

Copilot AI commented Jan 18, 2026

Adds HTTP server responding with 200 OK on /health, /healthz, and / for MinIO Sidekick load balancer health monitoring.

Changes

  • Health check server: Runs in background goroutine, starts on application launch
  • CLI flag: --healthport (default: 8080) configures listener port
  • Endpoints: All three paths return identical 200 OK responses

Implementation

// Added to main.go
func startHealthCheckServer(port string) {
    http.HandleFunc("/health", healthCheckHandler)
    http.HandleFunc("/healthz", healthCheckHandler)
    http.HandleFunc("/", healthCheckHandler)
    
    addr := ":" + port
    fmt.Printf("Starting health check server on %s\n", addr)
    if err := http.ListenAndServe(addr, nil); err != nil {
        fmt.Printf("Health check server error: %v\n", err)
    }
}

func healthCheckHandler(w http.ResponseWriter, r *http.Request) {
    w.WriteHeader(http.StatusOK)
    _, _ = w.Write([]byte("OK"))
}

// In main()
go startHealthCheckServer(*healthPort)

Non-invasive: health check runs independently of tape operations and S3 logic. Uses only Go standard library.

Original prompt

golang server that responds to minio sidekick health check with a 200


💬 We'd love your input! Share your thoughts on Copilot coding agent in our 2 minute survey.

Copilot AI and others added 2 commits January 18, 2026 23:12
Co-authored-by: DavidTrachy <7200403+DavidTrachy@users.noreply.github.com>
…e test

Co-authored-by: DavidTrachy <7200403+DavidTrachy@users.noreply.github.com>
Copilot AI changed the title [WIP] Add health check response for Minio sidekick Add HTTP health check endpoint for MinIO Sidekick Jan 18, 2026
Copilot AI requested a review from DavidTrachy January 18, 2026 23:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants