Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: disable tracing #40

Merged
merged 1 commit into from
Jan 6, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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 @@

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 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
Loading