Skip to content

Commit

Permalink
feat: add support for tracing
Browse files Browse the repository at this point in the history
  • Loading branch information
sujit-baniya committed Feb 18, 2024
1 parent 6af6901 commit be3f07e
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 6 deletions.
4 changes: 4 additions & 0 deletions examples/log.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
package main

func main() {
}
7 changes: 1 addition & 6 deletions examples/trace.go
Original file line number Diff line number Diff line change
Expand Up @@ -81,14 +81,9 @@ func TraceFunction(ctx context.Context, name string, fn func(ctx context.Context
tr := otel.Tracer(name)
ctx, span := tr.Start(ctx, name)
defer span.End()

span.SetAttributes(
attribute.KeyValue{
Key: "sujit_args",
Value: attribute.StringValue(fmt.Sprintf("%v", args)),
},
attribute.String("my_file", "test.txt"),
)

return fn(ctx, args...)
}

Expand Down

0 comments on commit be3f07e

Please sign in to comment.