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

fix: deployment changes #2

Merged
merged 2 commits into from
Mar 14, 2024
Merged
Show file tree
Hide file tree
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
2 changes: 0 additions & 2 deletions internal/metrics/metrics.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ import (
"time"

"github.com/go-chi/chi/v5"
"github.com/go-chi/chi/v5/middleware"
"github.com/prometheus/client_golang/prometheus/promhttp"
)

Expand All @@ -25,7 +24,6 @@ func (s *Server) Stop() error {
func NewServer(config Config) *Server {
r := chi.NewRouter()

r.Use(middleware.Heartbeat("/health"))
r.Handle("/metrics", promhttp.Handler())

return &Server{
Expand Down
4 changes: 3 additions & 1 deletion internal/proxy/healthchecker.go
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@
// want to perform an eth_call to make sure eth_call requests are also succeding
// as blockNumber can be either cached or routed to a different service on the
// RPC provider's side.
func (h *HealthChecker) checkGasLimit(c context.Context) (uint64, error) {

Check failure on line 96 in internal/proxy/healthchecker.go

View workflow job for this annotation

GitHub Actions / lint

func `(*HealthChecker).checkGasLimit` is unused (unused)
gasLimit, err := performGasLeftCall(c, h.httpClient, h.config.URL)
if err != nil {
h.logger.Error("could not fetch gas limit", "error", err)
Expand All @@ -111,7 +111,9 @@
// And sets the health status based on the responses.
func (h *HealthChecker) CheckAndSetHealth() {
go h.checkAndSetBlockNumberHealth()
go h.checkAndSetGasLeftHealth()

// Not being used for now as it requires on-chain setup
// go h.checkAndSetGasLeftHealth()
}

func (h *HealthChecker) checkAndSetBlockNumberHealth() {
Expand All @@ -133,7 +135,7 @@
h.blockNumber = blockNumber
}

func (h *HealthChecker) checkAndSetGasLeftHealth() {

Check failure on line 138 in internal/proxy/healthchecker.go

View workflow job for this annotation

GitHub Actions / lint

func `(*HealthChecker).checkAndSetGasLeftHealth` is unused (unused)
c, cancel := context.WithTimeout(context.Background(), h.config.Timeout)
defer cancel()

Expand Down
1 change: 1 addition & 0 deletions main.go
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,7 @@ func main() {
r := chi.NewRouter()
r.Use(httplog.RequestLogger(logger))
r.Use(middleware.Recoverer)
r.Use(middleware.Heartbeat("/health"))
server := &http.Server{
Addr: fmt.Sprintf(":%s", config.Port),
Handler: r,
Expand Down
Loading