From 7a3e289677f05f76acff24d120e83ede5dba1cc4 Mon Sep 17 00:00:00 2001 From: Bryan Frimin Date: Wed, 21 Jan 2026 09:28:45 -0800 Subject: [PATCH] Fix otel utf8 error Signed-off-by: Bryan Frimin --- pkg/server/gqlutils/tracing.go | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/pkg/server/gqlutils/tracing.go b/pkg/server/gqlutils/tracing.go index 0e2b11e3d..0d14adf31 100644 --- a/pkg/server/gqlutils/tracing.go +++ b/pkg/server/gqlutils/tracing.go @@ -17,6 +17,7 @@ package gqlutils import ( "context" "fmt" + "strings" "time" "github.com/99designs/gqlgen/graphql" @@ -87,9 +88,9 @@ func (t TracingExtension) InterceptOperation(ctx context.Context, next graphql.O defer span.End() span.SetAttributes( - attribute.String("graphql.operation_name", requestContext.OperationName), + attribute.String("graphql.operation_name", strings.ToValidUTF8(requestContext.OperationName, "\uFFFD")), attribute.String("graphql.operation_type", string(requestContext.Operation.Operation)), - attribute.String("graphql.query", requestContext.RawQuery), + attribute.String("graphql.query", strings.ToValidUTF8(requestContext.RawQuery, "\uFFFD")), ) }