Open
Description
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")
// add span
s1 := newrelic.StartSegment(txn, "my_span_five")
defer s1.End()
fmt.Println("ok five 1")
// time.Sleep(3 * time.Second)
client := &http.Client{}
client.Transport = newrelic.NewRoundTripper(client.Transport)
request, _ := http.NewRequest("GET", "http://127.0.0.1:9091/ohterhappytwo", nil)
// request, _ := http.NewRequest("GET", "http://127.0.0.1:8080/two", nil)
request = newrelic.RequestWithTransactionContext(request, txn)
response, _ := client.Do(request)
fmt.Println("resp--", response)
// add span
s2 := newrelic.StartSegment(txn, "my_span_four_five")
defer s2.End()
fmt.Println("ok three")
// time.Sleep(12 * time.Second)
defer txn.End()
}
Environment
win11