* use common traceID context value for opentracing and opentelemetry
* support sampled trace IDs as well
* inject traceID into NormalResponse on errors
* Finally the test passed
* fix the test
* fix linter
* change the function parameter
Co-authored-by: Ying WANG <ying.wang@grafana.com>
(cherry picked from commit 41012af997)
Co-authored-by: Serge Zaitsev <serge.zaitsev@grafana.com>
This commit is contained in:
committed by
GitHub
parent
a0ff246fcb
commit
c8327d04a8
@@ -16,7 +16,6 @@ import (
|
||||
"github.com/lib/pq"
|
||||
"github.com/mattn/go-sqlite3"
|
||||
"github.com/prometheus/client_golang/prometheus"
|
||||
cw "github.com/weaveworks/common/tracing"
|
||||
"xorm.io/core"
|
||||
)
|
||||
|
||||
@@ -83,7 +82,7 @@ func (h *databaseQueryWrapper) instrument(ctx context.Context, status string, qu
|
||||
elapsed := time.Since(begin)
|
||||
|
||||
histogram := databaseQueryHistogram.WithLabelValues(status)
|
||||
if traceID, ok := cw.ExtractSampledTraceID(ctx); ok {
|
||||
if traceID := tracing.TraceIDFromContext(ctx, true); traceID != "" {
|
||||
// Need to type-convert the Observer to an
|
||||
// ExemplarObserver. This will always work for a
|
||||
// HistogramVec.
|
||||
|
||||
Reference in New Issue
Block a user