Remove incorrect defer that was causing the datadog tracer to get stopped too early

This commit is contained in:
David Dworken 2023-09-13 21:54:32 -07:00
parent bc4d2b05f1
commit 0e085211a8
No known key found for this signature in database

View File

@ -2,15 +2,16 @@ package server
import ( import (
"fmt" "fmt"
httptrace "gopkg.in/DataDog/dd-trace-go.v1/contrib/net/http"
"gopkg.in/DataDog/dd-trace-go.v1/ddtrace/tracer"
"gopkg.in/DataDog/dd-trace-go.v1/profiler"
"math" "math"
"net/http" "net/http"
pprofhttp "net/http/pprof" pprofhttp "net/http/pprof"
"os" "os"
"runtime" "runtime"
"strconv" "strconv"
httptrace "gopkg.in/DataDog/dd-trace-go.v1/contrib/net/http"
"gopkg.in/DataDog/dd-trace-go.v1/ddtrace/tracer"
"gopkg.in/DataDog/dd-trace-go.v1/profiler"
) )
func getMaximumNumberOfAllowedUsers() int { func getMaximumNumberOfAllowedUsers() int {
@ -46,8 +47,6 @@ func configureObservability(mux *httptrace.ServeMux, releaseVersion string) func
tracer.WithService("hishtory-api"), tracer.WithService("hishtory-api"),
tracer.WithUDS("/var/run/datadog/apm.socket"), tracer.WithUDS("/var/run/datadog/apm.socket"),
) )
// TODO: should this be here?
defer tracer.Stop()
// Pprof // Pprof
mux.HandleFunc("/debug/pprof/", pprofhttp.Index) mux.HandleFunc("/debug/pprof/", pprofhttp.Index)