Skip to content

Commit

Permalink
tracing: add comments
Browse files Browse the repository at this point in the history
Signed-off-by: Stephan Renatus <stephan.renatus@gmail.com>
  • Loading branch information
srenatus committed Dec 14, 2021
1 parent 5813f38 commit c628317
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions tracing/tracing.go
Original file line number Diff line number Diff line change
Expand Up @@ -34,13 +34,19 @@ func RegisterHTTPTracing(ht HTTPTracingService) {
tracing = ht
}

// NewTransport returns another http.RoundTripper, instrumented to emit tracing
// spans according to Options. Provided by the HTTPTracingService registered with
// this package via RegisterHTTPTracing.
func NewTransport(tr http.RoundTripper, opts Options) http.RoundTripper {
if tracing == nil {
return tr
}
return tracing.NewTransport(tr, opts)
}

// NewHandler returns another http.Handler, instrumented to emit tracing spans
// according to Options. Provided by the HTTPTracingService registered with
// this package via RegisterHTTPTracing.
func NewHandler(f http.Handler, label string, opts Options) http.Handler {
if tracing == nil {
return f
Expand Down

0 comments on commit c628317

Please sign in to comment.