-
Notifications
You must be signed in to change notification settings - Fork 15
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: add health checks #259
Conversation
cmd/fdsn-holdings-consumer/main.go
Outdated
log.Fatalf("error checking queueURL %s: %s", queueURL, err.Error()) | ||
} | ||
|
||
s3c, err := s3.NewWithMaxRetries(3) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can we remove the pointer at L45, and getting rid of the s3c
here? Thanks
cmd/fdsn-holdings-consumer/main.go
Outdated
ping: | ||
for { | ||
err = db.Ping() | ||
if err != nil { | ||
log.Println("problem pinging DB sleeping and retrying") | ||
health.Ok() //send heartbeat |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not necessary. If the service stuck during initial DB connection then it's unhealthy
cmd/fdsn-quake-consumer/main.go
Outdated
ping: | ||
for { | ||
err = db.Ping() | ||
if err != nil { | ||
log.Println("problem pinging DB sleeping and retrying") | ||
health.Ok() //send heartbeat |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same as fdsn-holdings-consumer
cmd/fdsn-ws/server.go
Outdated
ctx, cancel := context.WithTimeout(context.Background(), timeout) | ||
defer cancel() | ||
|
||
msg, err := health.Check(ctx, ":8080/soh", timeout) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can we define ":8080" as a const, then both here and L88 uses that const?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good.
Ticket https://github.com/GeoNet/tickets/issues/13878
Add health check for services