feat(otel): add more tracing when communicating with internal tools / external APIs

This commit is contained in:
Julien Neuhart
2026-03-27 16:50:24 +01:00
parent 4e9f63004d
commit c72be765b0
8 changed files with 898 additions and 112 deletions

View File

@@ -14,6 +14,7 @@ import (
"go.opentelemetry.io/otel"
"go.opentelemetry.io/otel/codes"
"go.opentelemetry.io/otel/propagation"
semconv "go.opentelemetry.io/otel/semconv/v1.40.0"
"go.opentelemetry.io/otel/trace"
"github.com/gotenberg/gotenberg/v8/pkg/gotenberg"
@@ -50,7 +51,10 @@ func (c client) send(ctx context.Context, body io.Reader, headers map[string]str
}
tracer := gotenberg.Tracer()
ctx, span := tracer.Start(ctx, spanName, trace.WithSpanKind(trace.SpanKindClient))
ctx, span := tracer.Start(ctx, spanName,
trace.WithSpanKind(trace.SpanKindClient),
trace.WithAttributes(semconv.ServerAddress(url)),
)
defer span.End()
req, err := retryablehttp.NewRequest(method, url, body)