feat kafka
This commit is contained in:
@@ -14,6 +14,7 @@ import (
|
||||
"github.com/grpc-ecosystem/grpc-gateway/v2/runtime"
|
||||
"go.opentelemetry.io/contrib/instrumentation/github.com/gin-gonic/gin/otelgin"
|
||||
"google.golang.org/protobuf/encoding/protojson"
|
||||
"strings"
|
||||
)
|
||||
|
||||
func InitServeMux() *runtime.ServeMux {
|
||||
@@ -49,7 +50,13 @@ func InitRouter() *gin.Engine {
|
||||
gin.Recovery(),
|
||||
ginLogger(log.GetLogger().Named("GIN")),
|
||||
cors.New(corsConfig()),
|
||||
otelgin.Middleware(common.KeyDiscoverServiceNameGateway),
|
||||
otelgin.Middleware(
|
||||
common.KeyDiscoverServiceNameGateway,
|
||||
otelgin.WithSpanNameFormatter(func(c *gin.Context) string {
|
||||
method := strings.ToUpper(c.Request.Method)
|
||||
return method + " " + c.Request.URL.Path
|
||||
}),
|
||||
),
|
||||
)
|
||||
|
||||
r.HandleMethodNotAllowed = true
|
||||
|
||||
Reference in New Issue
Block a user