This commit is contained in:
parent
feb62f12b7
commit
e973fea5f3
@ -3,7 +3,6 @@ package middleware
|
|||||||
import (
|
import (
|
||||||
"fmt"
|
"fmt"
|
||||||
gc "gateway/config"
|
gc "gateway/config"
|
||||||
"gateway/core"
|
|
||||||
"github.com/gin-gonic/gin"
|
"github.com/gin-gonic/gin"
|
||||||
"github.com/opentracing/opentracing-go"
|
"github.com/opentracing/opentracing-go"
|
||||||
"github.com/opentracing/opentracing-go/ext"
|
"github.com/opentracing/opentracing-go/ext"
|
||||||
@ -21,7 +20,7 @@ func OpenTracing() gin.HandlerFunc {
|
|||||||
spCtx, err := opentracing.GlobalTracer().Extract(opentracing.HTTPHeaders, opentracing.HTTPHeadersCarrier(c.Request.Header))
|
spCtx, err := opentracing.GlobalTracer().Extract(opentracing.HTTPHeaders, opentracing.HTTPHeadersCarrier(c.Request.Header))
|
||||||
|
|
||||||
if err != nil {
|
if err != nil {
|
||||||
core.Log.Error("Jaeger错误: %v", err.Error())
|
//core.Log.Error("Jaeger错误: %v", err.Error())
|
||||||
parentSpan = tracer.StartSpan(c.Request.URL.Path)
|
parentSpan = tracer.StartSpan(c.Request.URL.Path)
|
||||||
defer parentSpan.Finish()
|
defer parentSpan.Finish()
|
||||||
} else {
|
} else {
|
||||||
|
Loading…
Reference in New Issue
Block a user