mirror of
https://github.com/gogf/gf.git
synced 2025-04-05 11:18:50 +08:00
feat:improve tracing
This commit is contained in:
parent
02c6deaec8
commit
25bdf10cc8
@ -55,7 +55,7 @@ func (c *Core) addSqlToTracing(ctx context.Context, sql *Sql) {
|
||||
labels = append(labels, gtrace.CommonLabels()...)
|
||||
labels = append(labels,
|
||||
attribute.String(tracingAttrDbType, c.db.GetConfig().Type),
|
||||
attribute.String(string(semconv.DBStatementKey), sql.Format),
|
||||
semconv.DBStatementKey.String(sql.Format),
|
||||
)
|
||||
if c.db.GetConfig().Host != "" {
|
||||
labels = append(labels, attribute.String(tracingAttrDbHost, c.db.GetConfig().Host))
|
||||
|
@ -133,7 +133,7 @@ const (
|
||||
contentTypeHtml = "text/html"
|
||||
contentTypeJson = "application/json"
|
||||
swaggerUIPackedPath = "/goframe/swaggerui"
|
||||
responseTraceIDHeader = "TraceID"
|
||||
responseTraceIDHeader = "Trace-ID"
|
||||
)
|
||||
|
||||
var (
|
||||
|
@ -12,7 +12,6 @@ import (
|
||||
"os"
|
||||
"strings"
|
||||
|
||||
"github.com/gogf/gf/v2/net/gtrace/internal/provider"
|
||||
"go.opentelemetry.io/otel"
|
||||
"go.opentelemetry.io/otel/attribute"
|
||||
"go.opentelemetry.io/otel/propagation"
|
||||
@ -23,6 +22,7 @@ import (
|
||||
"github.com/gogf/gf/v2/container/gvar"
|
||||
"github.com/gogf/gf/v2/internal/command"
|
||||
"github.com/gogf/gf/v2/net/gipv4"
|
||||
"github.com/gogf/gf/v2/net/gtrace/internal/provider"
|
||||
"github.com/gogf/gf/v2/util/gconv"
|
||||
)
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user