Skip to content

Commit

Permalink
Disable tracing temporarily (#2425)
Browse files Browse the repository at this point in the history
  • Loading branch information
kislaykishore authored Aug 30, 2024
1 parent f5bb7c9 commit bff9b25
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 13 deletions.
9 changes: 0 additions & 9 deletions internal/fs/wrappers/monitoring.go
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,6 @@ import (
"go.opencensus.io/stats"
"go.opencensus.io/stats/view"
"go.opencensus.io/tag"
"go.opentelemetry.io/otel/codes"
"go.opentelemetry.io/otel/trace"
)

var (
Expand Down Expand Up @@ -329,16 +327,9 @@ func (fs *monitoring) Destroy() {
type wrappedCall func() error

func invokeWrapped(ctx context.Context, opName string, w wrappedCall) error {
ctx, span := monitor.StartSpan(ctx, opName, trace.WithSpanKind(trace.SpanKindServer))
defer span.End()
startTime := time.Now()
err := w()

if err != nil {
span.RecordError(err)
span.SetStatus(codes.Error, err.Error())
}

recordOp(ctx, opName, startTime, err)
return err
}
Expand Down
5 changes: 1 addition & 4 deletions internal/fs/wrappers/monitoring_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,6 @@ import (
"go.opentelemetry.io/otel"
sdktrace "go.opentelemetry.io/otel/sdk/trace"
"go.opentelemetry.io/otel/sdk/trace/tracetest"
"go.opentelemetry.io/otel/trace"
)

func TestFsErrStrAndCategory(t *testing.T) {
Expand Down Expand Up @@ -246,7 +245,5 @@ func TestSpan(t *testing.T) {
require.NoError(t, err)

ss := ex.GetSpans()
require.Len(t, ss, 1)
assert.Equal(t, "StatFS", ss[0].Name)
assert.Equal(t, trace.SpanKindServer, ss[0].SpanKind)
require.Len(t, ss, 0)
}

0 comments on commit bff9b25

Please sign in to comment.