mirror of
https://github.com/go-kratos/kratos.git
synced 2025-11-06 08:59:18 +02:00
feat: add http transport interface (#1533)
feat: add http transport interface
This commit is contained in:
@@ -26,7 +26,7 @@ func setClientSpan(ctx context.Context, span trace.Span, m interface{}) {
|
||||
operation = tr.Operation()
|
||||
rpcKind = tr.Kind().String()
|
||||
if tr.Kind() == transport.KindHTTP {
|
||||
if ht, ok := tr.(*http.Transport); ok {
|
||||
if ht, ok := tr.(http.Transporter); ok {
|
||||
method := ht.Request().Method
|
||||
route := ht.PathTemplate()
|
||||
path := ht.Request().URL.Path
|
||||
@@ -61,7 +61,7 @@ func setServerSpan(ctx context.Context, span trace.Span, m interface{}) {
|
||||
operation = tr.Operation()
|
||||
rpcKind = tr.Kind().String()
|
||||
if tr.Kind() == transport.KindHTTP {
|
||||
if ht, ok := tr.(*http.Transport); ok {
|
||||
if ht, ok := tr.(http.Transporter); ok {
|
||||
method := ht.Request().Method
|
||||
route := ht.PathTemplate()
|
||||
path := ht.Request().URL.Path
|
||||
|
||||
Reference in New Issue
Block a user