Skip to content

Commit

Permalink
fixup! feat: Initial tracing implementation
Browse files Browse the repository at this point in the history
Increase default transport buffer size when tracing is enabled
  • Loading branch information
rhcarvalho committed Dec 3, 2020
1 parent 281b53a commit 7b44a67
Showing 1 changed file with 13 additions and 4 deletions.
17 changes: 13 additions & 4 deletions client.go
Original file line number Diff line number Diff line change
Expand Up @@ -240,17 +240,26 @@ func NewClient(options ClientOptions) (*Client, error) {
}

func (client *Client) setupTransport() {
transport := client.options.Transport
opts := client.options
transport := opts.Transport

if transport == nil {
if client.options.Dsn == "" {
if opts.Dsn == "" {
transport = new(noopTransport)
} else {
transport = NewHTTPTransport()
httpTransport := NewHTTPTransport()
// When tracing is enabled, use larger buffer to
// accommodate more concurrent events.
// TODO(tracing): consider using separate buffers per
// event type.
if opts.TracesSampleRate != 0 || opts.TracesSampler != nil {
httpTransport.BufferSize = 1000
}
transport = httpTransport
}
}

transport.Configure(client.options)
transport.Configure(opts)
client.Transport = transport
}

Expand Down

0 comments on commit 7b44a67

Please sign in to comment.