You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Remember that in Go, deferred functions are executed in reverse order (the last one deferred is the first one executed), as they are stored on a stack. This means that the txn.End() happens first when your function exits, so by the time it executes s2.End(), there isn't a transaction anymore for it to be reported in. You need to end the segment before you end the transaction.
picture
Description
use /five api , but not see span
my golang code
http.HandleFunc(newrelic.WrapHandleFunc(app, "/five", five))
func five(w http.ResponseWriter, r *http.Request) {
// txn := app.StartTransaction("tThree")
txn := newrelic.FromContext(r.Context())
fmt.Println("use five")
}
Environment
win11
The text was updated successfully, but these errors were encountered: