Skip to content

Commit

Permalink
chore: disable tracing
Browse files Browse the repository at this point in the history
  • Loading branch information
Vilsol committed Jan 6, 2024
1 parent cb2abc8 commit 2fdb734
Showing 1 changed file with 11 additions and 14 deletions.
25 changes: 11 additions & 14 deletions gql/gql_utils.go
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand All @@ -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(

Check failure on line 30 in gql/gql_utils.go

View workflow job for this annotation

GitHub Actions / Lint

commentFormatting: put a space between `//` and comment text (gocritic)

Check failure on line 30 in gql/gql_utils.go

View workflow job for this annotation

GitHub Actions / Lint

commentFormatting: put a space between `//` and comment text (gocritic)
// attribute.String("action_type", "API.graphql."+actionType),
//))

return TraceWrapper{
Span: span,
}, spanCtx
//Span: span,

Check failure on line 35 in gql/gql_utils.go

View workflow job for this annotation

GitHub Actions / Lint

File is not `gofumpt`-ed (gofumpt)

Check failure on line 35 in gql/gql_utils.go

View workflow job for this annotation

GitHub Actions / Lint

File is not `gofumpt`-ed (gofumpt)
}, 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()

Check failure on line 40 in gql/gql_utils.go

View workflow job for this annotation

GitHub Actions / Lint

commentFormatting: put a space between `//` and comment text (gocritic)

Check failure on line 40 in gql/gql_utils.go

View workflow job for this annotation

GitHub Actions / Lint

commentFormatting: put a space between `//` and comment text (gocritic)
//
//if err := recover(); err != nil {
// wrapper.Span.RecordError(fmt.Errorf("panic: %v", err))
// panic(err)
//}
}

// SetStringINNOE sets target if value not nil or empty
Expand Down

0 comments on commit 2fdb734

Please sign in to comment.