From 2fdb73442002471a249caa1b98d8e9100322b6d3 Mon Sep 17 00:00:00 2001 From: Vilsol Date: Sun, 7 Jan 2024 00:46:14 +0200 Subject: [PATCH] chore: disable tracing --- gql/gql_utils.go | 25 +++++++++++-------------- 1 file changed, 11 insertions(+), 14 deletions(-) diff --git a/gql/gql_utils.go b/gql/gql_utils.go index 5dbe22cf..9d1b63da 100644 --- a/gql/gql_utils.go +++ b/gql/gql_utils.go @@ -2,14 +2,11 @@ package gql import ( "context" - "fmt" "net" "net/http" "strings" "time" - "go.opentelemetry.io/otel" - "go.opentelemetry.io/otel/attribute" "go.opentelemetry.io/otel/trace" "github.com/satisfactorymodding/smr-api/db/postgres" @@ -30,22 +27,22 @@ func WrapMutationTrace(ctx context.Context, action string) (TraceWrapper, contex } func wrapTrace(ctx context.Context, action string, actionType string) (TraceWrapper, context.Context) { - spanCtx, span := otel.Tracer("gql").Start(ctx, "GraphQL "+action, trace.WithAttributes( - attribute.String("action_type", "API.graphql."+actionType), - )) + //spanCtx, span := otel.Tracer("gql").Start(ctx, "GraphQL "+action, trace.WithAttributes( + // attribute.String("action_type", "API.graphql."+actionType), + //)) return TraceWrapper{ - Span: span, - }, spanCtx + //Span: span, + }, ctx } func (wrapper TraceWrapper) end() { - defer wrapper.Span.End() - - if err := recover(); err != nil { - wrapper.Span.RecordError(fmt.Errorf("panic: %v", err)) - panic(err) - } + //defer wrapper.Span.End() + // + //if err := recover(); err != nil { + // wrapper.Span.RecordError(fmt.Errorf("panic: %v", err)) + // panic(err) + //} } // SetStringINNOE sets target if value not nil or empty