mirror of
https://github.com/grafana/grafana.git
synced 2024-11-23 09:26:43 -06:00
Tracing: Fix OpenTelemetry Jaeger context propagation (#53269)
* fix otel jaeger context propagation * add back launch.json * add back launch.json
This commit is contained in:
parent
44ea98b24f
commit
806fb8ab7a
@ -96,11 +96,11 @@ func (ots *Opentelemetry) parseSettingsOpentelemetry() error {
|
||||
ots.enabled = noopExporter
|
||||
|
||||
ots.address = section.Key("address").MustString("")
|
||||
ots.propagation = section.Key("propagation").MustString("")
|
||||
if ots.address != "" {
|
||||
ots.enabled = jaegerExporter
|
||||
return nil
|
||||
}
|
||||
ots.propagation = section.Key("propagation").MustString("")
|
||||
|
||||
section, err = ots.Cfg.Raw.GetSection("tracing.opentelemetry.otlp")
|
||||
if err != nil {
|
||||
@ -234,7 +234,7 @@ func (ots *Opentelemetry) Run(ctx context.Context) error {
|
||||
}
|
||||
|
||||
func (ots *Opentelemetry) Start(ctx context.Context, spanName string, opts ...trace.SpanStartOption) (context.Context, Span) {
|
||||
ctx, span := ots.tracer.Start(ctx, spanName)
|
||||
ctx, span := ots.tracer.Start(ctx, spanName, opts...)
|
||||
opentelemetrySpan := OpentelemetrySpan{
|
||||
span: span,
|
||||
}
|
||||
|
@ -72,7 +72,7 @@ func RequestTracing(tracer tracing.Tracer) web.Middleware {
|
||||
rw := web.Rw(w, req)
|
||||
|
||||
wireContext := otel.GetTextMapPropagator().Extract(req.Context(), propagation.HeaderCarrier(req.Header))
|
||||
ctx, span := tracer.Start(req.Context(), fmt.Sprintf("HTTP %s %s", req.Method, req.URL.Path), trace.WithLinks(trace.LinkFromContext(wireContext)))
|
||||
ctx, span := tracer.Start(wireContext, fmt.Sprintf("HTTP %s %s", req.Method, req.URL.Path), trace.WithLinks(trace.LinkFromContext(wireContext)))
|
||||
|
||||
req = req.WithContext(ctx)
|
||||
next.ServeHTTP(w, req)
|
||||
|
Loading…
Reference in New Issue
Block a user