Skip to content

Commit

Permalink
Stop using otelhttp due to memory leak #4922
Browse files Browse the repository at this point in the history
  • Loading branch information
tung2744 authored Dec 5, 2024
2 parents ced3a3f + 53da128 commit 45d5dc0
Showing 1 changed file with 9 additions and 4 deletions.
13 changes: 9 additions & 4 deletions pkg/util/httproute/httprouteotel/httprouteotel.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,10 +19,15 @@ type OTelRouter struct {
router Router
}

func NewOTelRouter(router Router) *OTelRouter {
return &OTelRouter{
router: router,
}
func NewOTelRouter(router Router) Router {
// It is observed that otelhttp >=v0.56 <=v0.57 has memory leak that
// causing memory usage increase over time.
// See https://github.com/open-telemetry/opentelemetry-go-contrib/issues/6315
// So let's stop using it.
// return &OTelRouter{
// router: router,
// }
return router
}

func (r *OTelRouter) wrapHandler(route httproute.Route, h http.Handler) http.Handler {
Expand Down

0 comments on commit 45d5dc0

Please sign in to comment.