Skip to content

Commit

Permalink
fix: remove healthcheck from healthcheck
Browse files Browse the repository at this point in the history
  • Loading branch information
Yeuoly committed Dec 17, 2024
1 parent 9ef9f16 commit a00e6ad
Showing 1 changed file with 23 additions and 8 deletions.
31 changes: 23 additions & 8 deletions internal/server/http_server.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,19 +17,34 @@ import (
sentrygin "github.com/getsentry/sentry-go/gin"
)

// server starts a http server and returns a function to stop it
func (app *App) server(config *app.Config) func() {
engine := gin.Default()
engine.GET("/health/check", controllers.HealthCheck)

endpointGroup := engine.Group("/endpoint")
awsLambdaTransactionGroup := engine.Group("/backwards-invocation")
pluginGroup := engine.Group("/plugin/:tenant_id")
pprofGroup := engine.Group("/debug/pprof")

if config.SentryEnabled {
engine.Use(sentrygin.New(sentrygin.Options{
Repanic: true,
}))
// setup sentry for all groups
sentryGroup := []*gin.RouterGroup{
endpointGroup,
awsLambdaTransactionGroup,
pluginGroup,
}
for _, group := range sentryGroup {
group.Use(sentrygin.New(sentrygin.Options{
Repanic: true,
}))
}
}
engine.GET("/health/check", controllers.HealthCheck)

app.endpointGroup(engine.Group("/e"), config)
app.awsLambdaTransactionGroup(engine.Group("/backwards-invocation"), config)
app.pluginGroup(engine.Group("/plugin/:tenant_id"), config)
app.pprofGroup(engine.Group("/debug/pprof"), config)
app.endpointGroup(endpointGroup, config)
app.awsLambdaTransactionGroup(awsLambdaTransactionGroup, config)
app.pluginGroup(pluginGroup, config)
app.pprofGroup(pprofGroup, config)

srv := &http.Server{
Addr: fmt.Sprintf(":%d", config.ServerPort),
Expand Down

0 comments on commit a00e6ad

Please sign in to comment.