Skip to content

Commit 6c2fcdf

Browse files
committed
Add instrumentation of creating broflake dialer
1 parent fff2180 commit 6c2fcdf

File tree

1 file changed

+9
-2
lines changed

1 file changed

+9
-2
lines changed

chained/broflake_impl.go

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ package chained
33
import (
44
"context"
55
"crypto/x509"
6+
"fmt"
67
"math/rand"
78
"net"
89
"time"
@@ -25,19 +26,25 @@ type broflakeImpl struct {
2526
}
2627

2728
func newBroflakeImpl(pc *config.ProxyConfig, reportDialCore reportDialCoreFn) (proxyImpl, error) {
29+
op := ops.Begin("new_broflake")
30+
defer op.End()
2831
// TODO: I don't know what the reportDialCoreFn is, and I'm not sure if I need to know. I'm
2932
// just imitating the function signature and approach of other impls...
3033
bo, wo, qo := makeBroflakeOptions(pc)
3134

3235
// Construct, init, and start a Broflake client!
3336
bfconn, ui, err := clientcore.NewBroflake(bo, wo, nil)
3437
if err != nil {
35-
return nil, err
38+
broErr := fmt.Errorf("Failed to create Broflake client: %w", err)
39+
op.FailIf(broErr)
40+
return nil, broErr
3641
}
3742

3843
ql, err := clientcore.NewQUICLayer(bfconn, qo)
3944
if err != nil {
40-
return nil, err
45+
broErr := fmt.Errorf("Failed to create QUIC layer: %w", err)
46+
op.FailIf(broErr)
47+
return nil, broErr
4148
}
4249

4350
go ql.DialAndMaintainQUICConnection()

0 commit comments

Comments
 (0)