Skip to content

Commit 8722897

Browse files
feat: add healthcheck endpoint (#71)
* add healthcheck endpoint * ensure helm chart uses new endpoint * chore: rename health to healthz Co-authored-by: Javier Provecho (Telefonica) <54402687+jpfe-tid@users.noreply.github.com>
1 parent a70c041 commit 8722897

File tree

2 files changed

+3
-2
lines changed

2 files changed

+3
-2
lines changed

helm/prometheus-kafka-adapter/templates/deployment.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -97,11 +97,11 @@ spec:
9797
protocol: TCP
9898
livenessProbe:
9999
httpGet:
100-
path: /metrics
100+
path: /healthz
101101
port: http
102102
readinessProbe:
103103
httpGet:
104-
path: /metrics
104+
path: /healthz
105105
port: http
106106
resources:
107107
{{- toYaml .Values.resources | nindent 12 }}

main.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -74,6 +74,7 @@ func main() {
7474
r.Use(ginrus.Ginrus(logrus.StandardLogger(), time.RFC3339, true), gin.Recovery())
7575

7676
r.GET("/metrics", gin.WrapH(prometheus.UninstrumentedHandler()))
77+
r.GET("/healthz", func(c *gin.Context) { c.JSON(200, gin.H{"status": "UP"}) })
7778
if basicauth {
7879
authorized := r.Group("/", gin.BasicAuth(gin.Accounts{
7980
basicauthUsername: basicauthPassword,

0 commit comments

Comments
 (0)