Skip to content
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

Add health api logs #11

Open
wants to merge 1 commit into
base: dev-cere
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions metrics/health/health.go
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,7 @@ func (s httpMetricServer) HealthStatus(w http.ResponseWriter, r *http.Request) {
return
}
}
log.Info("Health check request", "chain", chainName, "url", r.URL.String(), "height", s.stats[chainName].Height , "lastUpdated", s.stats[chainName].LastUpdated)

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What is your goal?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

After a discussion with @ADobrodey we couldn't understand the reasons why Stats API replied with an HTTP timeout error. He said that it is a problem with the application. As far as the logs were empty it was decided to add /health requests logs to see if Stats API can write logs in general and see if /health requests reach the server at the time of the error because it wasn't clear what happened with the application at the moment of the error.
Later I found in Grafana charts that the Stats API pod was updated and an HTTP timeout error happened at this time. Updated this information in DevOps ticket.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think right now it is up to you to decide if we need this PR request. From one side it is useful to see all logs. From the other side, there are too many logs in Bridge Relayer as /health requests happen very often.


err := json.NewEncoder(w).Encode(s.stats[chainName])
if err != nil {
Expand Down