mirror of
https://github.com/grafana/grafana.git
synced 2024-11-26 02:40:26 -06:00
Traces: Fix timestamp for database query traces (#61109)
This commit is contained in:
parent
7dcb502b33
commit
e7b17cde47
@ -10,13 +10,15 @@ import (
|
||||
|
||||
"github.com/gchaincl/sqlhooks"
|
||||
"github.com/go-sql-driver/mysql"
|
||||
"github.com/grafana/grafana/pkg/infra/log"
|
||||
"github.com/grafana/grafana/pkg/infra/tracing"
|
||||
"github.com/grafana/grafana/pkg/services/sqlstore/migrator"
|
||||
"github.com/lib/pq"
|
||||
"github.com/mattn/go-sqlite3"
|
||||
"github.com/prometheus/client_golang/prometheus"
|
||||
"go.opentelemetry.io/otel/trace"
|
||||
"xorm.io/core"
|
||||
|
||||
"github.com/grafana/grafana/pkg/infra/log"
|
||||
"github.com/grafana/grafana/pkg/infra/tracing"
|
||||
"github.com/grafana/grafana/pkg/services/sqlstore/migrator"
|
||||
)
|
||||
|
||||
var (
|
||||
@ -95,7 +97,7 @@ func (h *databaseQueryWrapper) instrument(ctx context.Context, status string, qu
|
||||
|
||||
ctx = log.IncDBCallCounter(ctx)
|
||||
|
||||
_, span := h.tracer.Start(ctx, "database query")
|
||||
_, span := h.tracer.Start(ctx, "database query", trace.WithTimestamp(begin))
|
||||
defer span.End()
|
||||
|
||||
span.AddEvents([]string{"query", "status"}, []tracing.EventValue{{Str: query}, {Str: status}})
|
||||
|
Loading…
Reference in New Issue
Block a user