Skip to content

Commit

Permalink
Fixed SAPM exporter. (#58)
Browse files Browse the repository at this point in the history
Updated depencency and fixed SAPM lib usage in a couple of places
  • Loading branch information
owais authored and tigrannajaryan committed Dec 11, 2019
1 parent 549afe2 commit c78990c
Show file tree
Hide file tree
Showing 6 changed files with 10 additions and 6 deletions.
6 changes: 3 additions & 3 deletions exporter/sapmexporter/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -31,12 +31,12 @@ type Config struct {

// NumWorkers is the number of workers that should be used to export traces.
// Exporter can make as many requests in parallel as the number of workers.
NumWorkers uint64 `mapstructure:"num_workers"`
NumWorkers uint `mapstructure:"num_workers"`

// MaxConnections is used to set a limit to the maximum idle HTTP connection the exporter can keep open.
MaxConnections uint64 `mapstructure:"max_connections"`
MaxConnections uint `mapstructure:"max_connections"`

// MaxRetries is maximum number of retry attempts the exporter should make before dropping a span batch.
// Note that right now this is only used when the server responds with HTTP 429 (tries to rate limit the client)
MaxRetries *uint64 `mapstructure:"max_retries"`
MaxRetries *uint `mapstructure:"max_retries"`
}
2 changes: 1 addition & 1 deletion exporter/sapmexporter/config_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ func TestLoadConfig(t *testing.T) {
assert.Equal(t, r0, factory.CreateDefaultConfig())

r1 := cfg.Exporters["sapm/customname"].(*Config)
maxRetries := uint64(10)
maxRetries := uint(10)
assert.Equal(t, r1,
&Config{
ExporterSettings: configmodels.ExporterSettings{TypeVal: typeStr, NameVal: "sapm/customname"},
Expand Down
2 changes: 1 addition & 1 deletion exporter/sapmexporter/exporter.go
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ func newSAPMTraceExporter(cfg *Config, logger *zap.Logger) (exporter.TraceExport
}

if cfg.AccessToken != "" {
opts = append(opts, sapmclient.WithAuthToken(cfg.AccessToken))
opts = append(opts, sapmclient.WithAccessToken(cfg.AccessToken))
}

client, err := sapmclient.New(opts...)
Expand Down
2 changes: 1 addition & 1 deletion exporter/sapmexporter/go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ go 1.12

require (
github.com/open-telemetry/opentelemetry-collector v0.2.1-0.20191119152140-567e1046cefa
github.com/signalfx/sapm-proto v0.0.3-0.20191210132251-3bc7d225b76d
github.com/signalfx/sapm-proto v0.0.3-0.20191211161027-5e20f16d64d6
github.com/stretchr/testify v1.4.0
go.uber.org/atomic v1.5.1 // indirect
go.uber.org/multierr v1.4.0 // indirect
Expand Down
2 changes: 2 additions & 0 deletions exporter/sapmexporter/go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -479,6 +479,8 @@ github.com/signalfx/golib/v3 v3.0.0/go.mod h1:p+krygP/cDlWvCBEgdkQp3H16rbP4NW7YQ
github.com/signalfx/gomemcache v0.0.0-20180823214636-4f7ef64c72a9/go.mod h1:Ytb8KfCSyuwy/VILnROdgCvbQLA5ch0nkbG7lKT0BXw=
github.com/signalfx/sapm-proto v0.0.3-0.20191210132251-3bc7d225b76d h1:FViLbVumRGKSV5LGSkZlXwCOkhklEOt84Y7MuKS29L4=
github.com/signalfx/sapm-proto v0.0.3-0.20191210132251-3bc7d225b76d/go.mod h1:IZihj/XeDgvA1z3fQx55O6V5LO3G8bC7rRkwySqDcng=
github.com/signalfx/sapm-proto v0.0.3-0.20191211161027-5e20f16d64d6 h1:yOY4t2Wtvr0tIcwvTzrHwihjwnVR7F/BitjcOMiY2wY=
github.com/signalfx/sapm-proto v0.0.3-0.20191211161027-5e20f16d64d6/go.mod h1:IZihj/XeDgvA1z3fQx55O6V5LO3G8bC7rRkwySqDcng=
github.com/signalfx/thrift v0.0.0-20181211001559-3838fa316492/go.mod h1:Xv29nl9fxdk0hmeqcUHgAZZwvYrOhduNW+9qk4H+6K0=
github.com/sirupsen/logrus v1.2.0/go.mod h1:LxeOpSwHxABJmUn/MG1IvRgCAasNZTLOkJPxbbu5VWo=
github.com/sirupsen/logrus v1.4.2/go.mod h1:tLMulIdttU9McNUspp0xgXVQah82FyeX6MwdIuYE2rE=
Expand Down
2 changes: 2 additions & 0 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -636,6 +636,8 @@ github.com/signalfx/gomemcache v0.0.0-20180823214636-4f7ef64c72a9/go.mod h1:Ytb8
github.com/signalfx/sapm-proto v0.0.2/go.mod h1:mnxTtJuYpsmOFW0F+f95bazdXGUnvjMMwbRNgSjaDb4=
github.com/signalfx/sapm-proto v0.0.3-0.20191210132251-3bc7d225b76d h1:FViLbVumRGKSV5LGSkZlXwCOkhklEOt84Y7MuKS29L4=
github.com/signalfx/sapm-proto v0.0.3-0.20191210132251-3bc7d225b76d/go.mod h1:IZihj/XeDgvA1z3fQx55O6V5LO3G8bC7rRkwySqDcng=
github.com/signalfx/sapm-proto v0.0.3-0.20191211161027-5e20f16d64d6 h1:yOY4t2Wtvr0tIcwvTzrHwihjwnVR7F/BitjcOMiY2wY=
github.com/signalfx/sapm-proto v0.0.3-0.20191211161027-5e20f16d64d6/go.mod h1:IZihj/XeDgvA1z3fQx55O6V5LO3G8bC7rRkwySqDcng=
github.com/signalfx/thrift v0.0.0-20181211001559-3838fa316492/go.mod h1:Xv29nl9fxdk0hmeqcUHgAZZwvYrOhduNW+9qk4H+6K0=
github.com/sirupsen/logrus v1.2.0/go.mod h1:LxeOpSwHxABJmUn/MG1IvRgCAasNZTLOkJPxbbu5VWo=
github.com/sirupsen/logrus v1.4.2 h1:SPIRibHv4MatM3XXNO2BJeFLZwZ2LvZgfQ5+UNI2im4=
Expand Down

0 comments on commit c78990c

Please sign in to comment.