From fe953d2ea449381b4ff261e251c72590cd132ff7 Mon Sep 17 00:00:00 2001 From: Owais Lone Date: Wed, 11 Dec 2019 20:15:59 +0530 Subject: [PATCH] Fixed SAPM exporter. Updated depencency and fixed SAPM lib usage in a couple of places --- exporter/sapmexporter/config.go | 6 +++--- exporter/sapmexporter/config_test.go | 2 +- exporter/sapmexporter/exporter.go | 2 +- exporter/sapmexporter/go.mod | 2 +- exporter/sapmexporter/go.sum | 2 ++ go.sum | 2 ++ 6 files changed, 10 insertions(+), 6 deletions(-) diff --git a/exporter/sapmexporter/config.go b/exporter/sapmexporter/config.go index 05baa7db813e..cc1b366524f7 100644 --- a/exporter/sapmexporter/config.go +++ b/exporter/sapmexporter/config.go @@ -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"` } diff --git a/exporter/sapmexporter/config_test.go b/exporter/sapmexporter/config_test.go index 21a0214c4c3a..024ae7580dd1 100644 --- a/exporter/sapmexporter/config_test.go +++ b/exporter/sapmexporter/config_test.go @@ -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"}, diff --git a/exporter/sapmexporter/exporter.go b/exporter/sapmexporter/exporter.go index 9b9d87a252ce..0e4f4c72b620 100644 --- a/exporter/sapmexporter/exporter.go +++ b/exporter/sapmexporter/exporter.go @@ -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...) diff --git a/exporter/sapmexporter/go.mod b/exporter/sapmexporter/go.mod index d3e1a099664f..76cf1baf19c9 100644 --- a/exporter/sapmexporter/go.mod +++ b/exporter/sapmexporter/go.mod @@ -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 diff --git a/exporter/sapmexporter/go.sum b/exporter/sapmexporter/go.sum index 3bc43f5e05da..a08e111a3fcf 100644 --- a/exporter/sapmexporter/go.sum +++ b/exporter/sapmexporter/go.sum @@ -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= diff --git a/go.sum b/go.sum index 5524683c57ff..16d13093c677 100644 --- a/go.sum +++ b/go.sum @@ -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=