Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update code to use latest core dependency #192

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion exporter/awsxrayexporter/awsxray.go
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ import (
// NewTraceExporter creates an component.TraceExporterOld that converts to an X-Ray PutTraceSegments
// request and then posts the request to the configured region's X-Ray endpoint.
func NewTraceExporter(config configmodels.Exporter, logger *zap.Logger, cn connAttr) (component.TraceExporterOld, error) {
typeLog := zap.String("type", config.Type())
typeLog := zap.String("type", string(config.Type()))
nameLog := zap.String("name", config.Name())
awsConfig, session, err := GetAWSConfigSession(logger, cn, config.(*Config))
if err != nil {
Expand Down
4 changes: 2 additions & 2 deletions exporter/awsxrayexporter/config_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ func TestLoadConfig(t *testing.T) {
assert.Nil(t, err)

factory := &Factory{}
factories.Exporters[typeStr] = factory
factories.Exporters[configmodels.Type(typeStr)] = factory
cfg, err := config.LoadConfigFile(
t, path.Join(".", "testdata", "config.yaml"), factories,
)
Expand All @@ -45,7 +45,7 @@ func TestLoadConfig(t *testing.T) {
r1 := cfg.Exporters["awsxray/customname"].(*Config)
assert.Equal(t, r1,
&Config{
ExporterSettings: configmodels.ExporterSettings{TypeVal: typeStr, NameVal: "awsxray/customname"},
ExporterSettings: configmodels.ExporterSettings{TypeVal: configmodels.Type(typeStr), NameVal: "awsxray/customname"},
NumberOfWorkers: 8,
Endpoint: "",
RequestTimeoutSeconds: 30,
Expand Down
6 changes: 3 additions & 3 deletions exporter/awsxrayexporter/factory.go
Original file line number Diff line number Diff line change
Expand Up @@ -31,15 +31,15 @@ type Factory struct {
}

// Type gets the type of the Exporter config created by this factory.
func (f *Factory) Type() string {
return typeStr
func (f *Factory) Type() configmodels.Type {
return configmodels.Type(typeStr)
}

// CreateDefaultConfig creates the default configuration for exporter.
func (f *Factory) CreateDefaultConfig() configmodels.Exporter {
return &Config{
ExporterSettings: configmodels.ExporterSettings{
TypeVal: typeStr,
TypeVal: configmodels.Type(typeStr),
NameVal: typeStr,
},
NumberOfWorkers: 8,
Expand Down
5 changes: 3 additions & 2 deletions exporter/awsxrayexporter/factory_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ import (

"github.com/open-telemetry/opentelemetry-collector/config"
"github.com/open-telemetry/opentelemetry-collector/config/configcheck"
"github.com/open-telemetry/opentelemetry-collector/config/configmodels"
"github.com/stretchr/testify/assert"
"github.com/stretchr/testify/require"
"go.uber.org/zap"
Expand All @@ -38,7 +39,7 @@ func TestCreateTraceExporter(t *testing.T) {
factories, err := config.ExampleComponents()
require.NoError(t, err)
factory := Factory{}
factories.Exporters[typeStr] = &factory
factories.Exporters[configmodels.Type(typeStr)] = &factory
cfg, err := config.LoadConfigFile(
t, path.Join(".", "testdata", "config.yaml"), factories,
)
Expand All @@ -55,7 +56,7 @@ func TestCreateMetricsExporter(t *testing.T) {
factories, err := config.ExampleComponents()
require.NoError(t, err)
factory := Factory{}
factories.Exporters[typeStr] = &factory
factories.Exporters[configmodels.Type(typeStr)] = &factory
cfg, err := config.LoadConfigFile(
t, path.Join(".", "testdata", "config.yaml"), factories,
)
Expand Down
2 changes: 1 addition & 1 deletion exporter/awsxrayexporter/go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ require (
github.com/census-instrumentation/opencensus-proto v0.2.1
github.com/golang/protobuf v1.3.5
github.com/mattn/go-isatty v0.0.10 // indirect
github.com/open-telemetry/opentelemetry-collector v0.3.1-0.20200423174807-6c194144a519
github.com/open-telemetry/opentelemetry-collector v0.3.1-0.20200424155504-9d16f5971ef9
github.com/stretchr/testify v1.4.0
go.uber.org/zap v1.10.0
golang.org/x/net v0.0.0-20200324143707-d3edc9973b7e
Expand Down
4 changes: 2 additions & 2 deletions exporter/awsxrayexporter/go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -912,8 +912,8 @@ github.com/onsi/gomega v1.7.1/go.mod h1:XdKZgCCFLUoM/7CFJVPcG8C1xQ1AJ0vpAezJrB7J
github.com/onsi/gomega v1.8.1/go.mod h1:Ho0h+IUsWyvy1OpqCwxlQ/21gkhVunqlU8fDGcoTdcA=
github.com/onsi/gomega v1.9.0 h1:R1uwffexN6Pr340GtYRIdZmAiN4J+iw6WG4wog1DUXg=
github.com/onsi/gomega v1.9.0/go.mod h1:Ho0h+IUsWyvy1OpqCwxlQ/21gkhVunqlU8fDGcoTdcA=
github.com/open-telemetry/opentelemetry-collector v0.3.1-0.20200423174807-6c194144a519 h1:j4lzNcXgPE50pZ7n77s/Mnh7EKBZ2e+k34Qhsuiv36c=
github.com/open-telemetry/opentelemetry-collector v0.3.1-0.20200423174807-6c194144a519/go.mod h1:aZAL+YwTtk+1YkTj8dDgTvv06dU8twzOdRowRtBfEKo=
github.com/open-telemetry/opentelemetry-collector v0.3.1-0.20200424155504-9d16f5971ef9 h1:maf2tPAv8QV17gSAePuzREqKvConQ+ozOkNM0pFgbyA=
github.com/open-telemetry/opentelemetry-collector v0.3.1-0.20200424155504-9d16f5971ef9/go.mod h1:aZAL+YwTtk+1YkTj8dDgTvv06dU8twzOdRowRtBfEKo=
github.com/open-telemetry/opentelemetry-proto v0.3.0 h1:+ASAtcayvoELyCF40+rdCMlBOhZIn5TPDez85zSYc30=
github.com/open-telemetry/opentelemetry-proto v0.3.0/go.mod h1:PMR5GI0F7BSpio+rBGFxNm6SLzg3FypDTcFuQZnO+F8=
github.com/opencontainers/go-digest v1.0.0-rc1/go.mod h1:cMLVZDEM3+U2I4VmLI6N8jQYUd2OVphdqWwCJHrFt2s=
Expand Down
4 changes: 2 additions & 2 deletions exporter/azuremonitorexporter/config_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ func TestLoadConfig(t *testing.T) {
assert.Nil(t, err)

factory := &Factory{}
factories.Exporters[typeStr] = factory
factories.Exporters[configmodels.Type(typeStr)] = factory
cfg, err := config.LoadConfigFile(
t, path.Join(".", "testdata", "config.yaml"), factories,
)
Expand All @@ -51,7 +51,7 @@ func TestLoadConfig(t *testing.T) {
assert.Equal(
t,
&Config{
ExporterSettings: configmodels.ExporterSettings{TypeVal: typeStr, NameVal: exporterType},
ExporterSettings: configmodels.ExporterSettings{TypeVal: configmodels.Type(typeStr), NameVal: exporterType},
Endpoint: defaultEndpoint,
InstrumentationKey: "abcdefg",
MaxBatchSize: 100,
Expand Down
6 changes: 3 additions & 3 deletions exporter/azuremonitorexporter/factory.go
Original file line number Diff line number Diff line change
Expand Up @@ -42,16 +42,16 @@ type Factory struct {
}

// Type gets the type of the Exporter config created by this factory.
func (f *Factory) Type() string {
return typeStr
func (f *Factory) Type() configmodels.Type {
return configmodels.Type(typeStr)
}

// CreateDefaultConfig creates the default configuration for exporter.
func (f *Factory) CreateDefaultConfig() configmodels.Exporter {

return &Config{
ExporterSettings: configmodels.ExporterSettings{
TypeVal: typeStr,
TypeVal: configmodels.Type(typeStr),
NameVal: typeStr,
},
Endpoint: defaultEndpoint,
Expand Down
3 changes: 2 additions & 1 deletion exporter/azuremonitorexporter/factory_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,14 +18,15 @@ import (
"testing"

"github.com/open-telemetry/opentelemetry-collector/config/configerror"
"github.com/open-telemetry/opentelemetry-collector/config/configmodels"
"github.com/stretchr/testify/assert"
"go.uber.org/zap"
)

func TestExporterTypeKey(t *testing.T) {
factory := Factory{}

assert.Equal(t, typeStr, factory.Type())
assert.Equal(t, configmodels.Type(typeStr), factory.Type())
}

func TestCreateMetricsExporter(t *testing.T) {
Expand Down
2 changes: 1 addition & 1 deletion exporter/azuremonitorexporter/go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ require (
github.com/aws/aws-sdk-go v1.23.20 // indirect
github.com/census-instrumentation/opencensus-proto v0.2.1
github.com/golang/protobuf v1.3.5
github.com/open-telemetry/opentelemetry-collector v0.3.1-0.20200423174807-6c194144a519
github.com/open-telemetry/opentelemetry-collector v0.3.1-0.20200424155504-9d16f5971ef9
github.com/stretchr/testify v1.4.0
github.com/tedsuo/ifrit v0.0.0-20191009134036-9a97d0632f00 // indirect
go.uber.org/multierr v1.4.0 // indirect
Expand Down
4 changes: 2 additions & 2 deletions exporter/azuremonitorexporter/go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -834,8 +834,8 @@ github.com/onsi/gomega v1.7.1/go.mod h1:XdKZgCCFLUoM/7CFJVPcG8C1xQ1AJ0vpAezJrB7J
github.com/onsi/gomega v1.8.1/go.mod h1:Ho0h+IUsWyvy1OpqCwxlQ/21gkhVunqlU8fDGcoTdcA=
github.com/onsi/gomega v1.9.0 h1:R1uwffexN6Pr340GtYRIdZmAiN4J+iw6WG4wog1DUXg=
github.com/onsi/gomega v1.9.0/go.mod h1:Ho0h+IUsWyvy1OpqCwxlQ/21gkhVunqlU8fDGcoTdcA=
github.com/open-telemetry/opentelemetry-collector v0.3.1-0.20200423174807-6c194144a519 h1:j4lzNcXgPE50pZ7n77s/Mnh7EKBZ2e+k34Qhsuiv36c=
github.com/open-telemetry/opentelemetry-collector v0.3.1-0.20200423174807-6c194144a519/go.mod h1:aZAL+YwTtk+1YkTj8dDgTvv06dU8twzOdRowRtBfEKo=
github.com/open-telemetry/opentelemetry-collector v0.3.1-0.20200424155504-9d16f5971ef9 h1:maf2tPAv8QV17gSAePuzREqKvConQ+ozOkNM0pFgbyA=
github.com/open-telemetry/opentelemetry-collector v0.3.1-0.20200424155504-9d16f5971ef9/go.mod h1:aZAL+YwTtk+1YkTj8dDgTvv06dU8twzOdRowRtBfEKo=
github.com/open-telemetry/opentelemetry-proto v0.3.0 h1:+ASAtcayvoELyCF40+rdCMlBOhZIn5TPDez85zSYc30=
github.com/open-telemetry/opentelemetry-proto v0.3.0/go.mod h1:PMR5GI0F7BSpio+rBGFxNm6SLzg3FypDTcFuQZnO+F8=
github.com/opencontainers/go-digest v1.0.0-rc1/go.mod h1:cMLVZDEM3+U2I4VmLI6N8jQYUd2OVphdqWwCJHrFt2s=
Expand Down
2 changes: 1 addition & 1 deletion exporter/carbonexporter/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ type Config struct {
func defaultConfig() *Config {
return &Config{
ExporterSettings: configmodels.ExporterSettings{
TypeVal: typeStr,
TypeVal: configmodels.Type(typeStr),
NameVal: typeStr,
},
Endpoint: DefaultEndpoint,
Expand Down
4 changes: 2 additions & 2 deletions exporter/carbonexporter/config_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ func TestLoadConfig(t *testing.T) {
assert.Nil(t, err)

factory := &Factory{}
factories.Exporters[typeStr] = factory
factories.Exporters[configmodels.Type(typeStr)] = factory
cfg, err := config.LoadConfigFile(t, path.Join(".", "testdata", "config.yaml"), factories)

require.NoError(t, err)
Expand All @@ -48,7 +48,7 @@ func TestLoadConfig(t *testing.T) {
e1 := cfg.Exporters[expectedName]
expectedCfg := Config{
ExporterSettings: configmodels.ExporterSettings{
TypeVal: typeStr,
TypeVal: configmodels.Type(typeStr),
NameVal: expectedName,
},
Endpoint: "localhost:8080",
Expand Down
4 changes: 2 additions & 2 deletions exporter/carbonexporter/factory.go
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,8 @@ type Factory struct {
}

// Type gets the type of the Exporter config created by this factory.
func (f *Factory) Type() string {
return typeStr
func (f *Factory) Type() configmodels.Type {
return configmodels.Type(typeStr)
}

// CreateDefaultConfig creates the default configuration for exporter.
Expand Down
3 changes: 2 additions & 1 deletion exporter/carbonexporter/factory_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ import (

"github.com/open-telemetry/opentelemetry-collector/config/configcheck"
"github.com/open-telemetry/opentelemetry-collector/config/configerror"
"github.com/open-telemetry/opentelemetry-collector/config/configmodels"
"github.com/stretchr/testify/assert"
"github.com/stretchr/testify/require"
"go.uber.org/zap"
Expand All @@ -36,7 +37,7 @@ func TestCreateMetricsExporter(t *testing.T) {
factory := Factory{}
cfg := factory.CreateDefaultConfig()

assert.Equal(t, typeStr, factory.Type())
assert.Equal(t, configmodels.Type(typeStr), factory.Type())
_, err := factory.CreateMetricsExporter(zap.NewNop(), cfg)
assert.NoError(t, err)
}
Expand Down
2 changes: 1 addition & 1 deletion exporter/carbonexporter/go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ go 1.14

require (
github.com/census-instrumentation/opencensus-proto v0.2.1
github.com/open-telemetry/opentelemetry-collector v0.3.1-0.20200423174807-6c194144a519
github.com/open-telemetry/opentelemetry-collector v0.3.1-0.20200424155504-9d16f5971ef9
github.com/stretchr/testify v1.4.0
go.uber.org/zap v1.10.0
)
4 changes: 2 additions & 2 deletions exporter/carbonexporter/go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -829,8 +829,8 @@ github.com/onsi/gomega v1.7.1/go.mod h1:XdKZgCCFLUoM/7CFJVPcG8C1xQ1AJ0vpAezJrB7J
github.com/onsi/gomega v1.8.1/go.mod h1:Ho0h+IUsWyvy1OpqCwxlQ/21gkhVunqlU8fDGcoTdcA=
github.com/onsi/gomega v1.9.0 h1:R1uwffexN6Pr340GtYRIdZmAiN4J+iw6WG4wog1DUXg=
github.com/onsi/gomega v1.9.0/go.mod h1:Ho0h+IUsWyvy1OpqCwxlQ/21gkhVunqlU8fDGcoTdcA=
github.com/open-telemetry/opentelemetry-collector v0.3.1-0.20200423174807-6c194144a519 h1:j4lzNcXgPE50pZ7n77s/Mnh7EKBZ2e+k34Qhsuiv36c=
github.com/open-telemetry/opentelemetry-collector v0.3.1-0.20200423174807-6c194144a519/go.mod h1:aZAL+YwTtk+1YkTj8dDgTvv06dU8twzOdRowRtBfEKo=
github.com/open-telemetry/opentelemetry-collector v0.3.1-0.20200424155504-9d16f5971ef9 h1:maf2tPAv8QV17gSAePuzREqKvConQ+ozOkNM0pFgbyA=
github.com/open-telemetry/opentelemetry-collector v0.3.1-0.20200424155504-9d16f5971ef9/go.mod h1:aZAL+YwTtk+1YkTj8dDgTvv06dU8twzOdRowRtBfEKo=
github.com/open-telemetry/opentelemetry-proto v0.3.0 h1:+ASAtcayvoELyCF40+rdCMlBOhZIn5TPDez85zSYc30=
github.com/open-telemetry/opentelemetry-proto v0.3.0/go.mod h1:PMR5GI0F7BSpio+rBGFxNm6SLzg3FypDTcFuQZnO+F8=
github.com/opencontainers/go-digest v1.0.0-rc1/go.mod h1:cMLVZDEM3+U2I4VmLI6N8jQYUd2OVphdqWwCJHrFt2s=
Expand Down
4 changes: 2 additions & 2 deletions exporter/honeycombexporter/config_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ func TestLoadConfig(t *testing.T) {
assert.Nil(t, err)

factory := &Factory{}
factories.Exporters[typeStr] = factory
factories.Exporters[configmodels.Type(typeStr)] = factory
cfg, err := config.LoadConfigFile(
t, path.Join(".", "testdata", "config.yaml"), factories,
)
Expand All @@ -44,7 +44,7 @@ func TestLoadConfig(t *testing.T) {

r1 := cfg.Exporters["honeycomb/customname"].(*Config)
assert.Equal(t, r1, &Config{
ExporterSettings: configmodels.ExporterSettings{TypeVal: typeStr, NameVal: "honeycomb/customname"},
ExporterSettings: configmodels.ExporterSettings{TypeVal: configmodels.Type(typeStr), NameVal: "honeycomb/customname"},
APIKey: "test-apikey",
Dataset: "test-dataset",
APIURL: "https://api.testhost.io",
Expand Down
6 changes: 3 additions & 3 deletions exporter/honeycombexporter/factory.go
Original file line number Diff line number Diff line change
Expand Up @@ -30,15 +30,15 @@ const (
type Factory struct{}

// Type gets the type of the Exporter config created by this factory.
func (f *Factory) Type() string {
return typeStr
func (f *Factory) Type() configmodels.Type {
return configmodels.Type(typeStr)
}

// CreateDefaultConfig creates the default configuration for the exporter.
func (f *Factory) CreateDefaultConfig() configmodels.Exporter {
return &Config{
ExporterSettings: configmodels.ExporterSettings{
TypeVal: typeStr,
TypeVal: configmodels.Type(typeStr),
NameVal: typeStr,
},
APIKey: "",
Expand Down
5 changes: 3 additions & 2 deletions exporter/honeycombexporter/factory_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ import (

"github.com/open-telemetry/opentelemetry-collector/config"
"github.com/open-telemetry/opentelemetry-collector/config/configcheck"
"github.com/open-telemetry/opentelemetry-collector/config/configmodels"
"github.com/stretchr/testify/assert"
"github.com/stretchr/testify/require"
"go.uber.org/zap"
Expand All @@ -38,7 +39,7 @@ func TestCreateTraceExporter(t *testing.T) {
factories, err := config.ExampleComponents()
require.NoError(t, err)
factory := Factory{}
factories.Exporters[typeStr] = &factory
factories.Exporters[configmodels.Type(typeStr)] = &factory
cfg, err := config.LoadConfigFile(
t, path.Join(".", "testdata", "config.yaml"), factories,
)
Expand All @@ -55,7 +56,7 @@ func TestCreateMetricsExporter(t *testing.T) {
factories, err := config.ExampleComponents()
require.NoError(t, err)
factory := Factory{}
factories.Exporters[typeStr] = &factory
factories.Exporters[configmodels.Type(typeStr)] = &factory
cfg, err := config.LoadConfigFile(
t, path.Join(".", "testdata", "config.yaml"), factories,
)
Expand Down
2 changes: 1 addition & 1 deletion exporter/honeycombexporter/go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ require (
github.com/google/go-cmp v0.4.0
github.com/honeycombio/opentelemetry-exporter-go v0.3.1
github.com/klauspost/compress v1.10.2
github.com/open-telemetry/opentelemetry-collector v0.3.1-0.20200423174807-6c194144a519
github.com/open-telemetry/opentelemetry-collector v0.3.1-0.20200424155504-9d16f5971ef9
github.com/stretchr/testify v1.5.1
go.opentelemetry.io/otel v0.3.0
go.uber.org/zap v1.14.0
Expand Down
4 changes: 2 additions & 2 deletions exporter/honeycombexporter/go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -854,8 +854,8 @@ github.com/onsi/gomega v1.7.1/go.mod h1:XdKZgCCFLUoM/7CFJVPcG8C1xQ1AJ0vpAezJrB7J
github.com/onsi/gomega v1.8.1/go.mod h1:Ho0h+IUsWyvy1OpqCwxlQ/21gkhVunqlU8fDGcoTdcA=
github.com/onsi/gomega v1.9.0 h1:R1uwffexN6Pr340GtYRIdZmAiN4J+iw6WG4wog1DUXg=
github.com/onsi/gomega v1.9.0/go.mod h1:Ho0h+IUsWyvy1OpqCwxlQ/21gkhVunqlU8fDGcoTdcA=
github.com/open-telemetry/opentelemetry-collector v0.3.1-0.20200423174807-6c194144a519 h1:j4lzNcXgPE50pZ7n77s/Mnh7EKBZ2e+k34Qhsuiv36c=
github.com/open-telemetry/opentelemetry-collector v0.3.1-0.20200423174807-6c194144a519/go.mod h1:aZAL+YwTtk+1YkTj8dDgTvv06dU8twzOdRowRtBfEKo=
github.com/open-telemetry/opentelemetry-collector v0.3.1-0.20200424155504-9d16f5971ef9 h1:maf2tPAv8QV17gSAePuzREqKvConQ+ozOkNM0pFgbyA=
github.com/open-telemetry/opentelemetry-collector v0.3.1-0.20200424155504-9d16f5971ef9/go.mod h1:aZAL+YwTtk+1YkTj8dDgTvv06dU8twzOdRowRtBfEKo=
github.com/open-telemetry/opentelemetry-proto v0.3.0 h1:+ASAtcayvoELyCF40+rdCMlBOhZIn5TPDez85zSYc30=
github.com/open-telemetry/opentelemetry-proto v0.3.0/go.mod h1:PMR5GI0F7BSpio+rBGFxNm6SLzg3FypDTcFuQZnO+F8=
github.com/opencontainers/go-digest v1.0.0-rc1/go.mod h1:cMLVZDEM3+U2I4VmLI6N8jQYUd2OVphdqWwCJHrFt2s=
Expand Down
4 changes: 2 additions & 2 deletions exporter/jaegerthrifthttpexporter/config_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ func TestLoadConfig(t *testing.T) {
assert.Nil(t, err)

factory := &Factory{}
factories.Exporters[typeStr] = factory
factories.Exporters[configmodels.Type(typeStr)] = factory
cfg, err := config.LoadConfigFile(t, path.Join(".", "testdata", "config.yaml"), factories)

require.NoError(t, err)
Expand All @@ -49,7 +49,7 @@ func TestLoadConfig(t *testing.T) {
e1 := cfg.Exporters[expectedName]
expectedCfg := Config{
ExporterSettings: configmodels.ExporterSettings{
TypeVal: typeStr,
TypeVal: configmodels.Type(typeStr),
NameVal: expectedName,
},
URL: "http://some.other.location/api/traces",
Expand Down
6 changes: 3 additions & 3 deletions exporter/jaegerthrifthttpexporter/factory.go
Original file line number Diff line number Diff line change
Expand Up @@ -34,15 +34,15 @@ type Factory struct {
}

// Type gets the type of the Exporter config created by this factory.
func (f *Factory) Type() string {
return typeStr
func (f *Factory) Type() configmodels.Type {
return configmodels.Type(typeStr)
}

// CreateDefaultConfig creates the default configuration for exporter.
func (f *Factory) CreateDefaultConfig() configmodels.Exporter {
return &Config{
ExporterSettings: configmodels.ExporterSettings{
TypeVal: typeStr,
TypeVal: configmodels.Type(typeStr),
NameVal: typeStr,
},
Timeout: defaultHTTPTimeout,
Expand Down
8 changes: 4 additions & 4 deletions exporter/jaegerthrifthttpexporter/factory_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ func TestFactory_CreateTraceExporter(t *testing.T) {
f := &Factory{}
config := &Config{
ExporterSettings: configmodels.ExporterSettings{
TypeVal: typeStr,
TypeVal: configmodels.Type(typeStr),
NameVal: typeStr,
},
URL: "http://some.other.location/api/traces",
Expand All @@ -94,7 +94,7 @@ func TestFactory_CreateTraceExporterFails(t *testing.T) {
name: "empty_url",
config: &Config{
ExporterSettings: configmodels.ExporterSettings{
TypeVal: typeStr,
TypeVal: configmodels.Type(typeStr),
NameVal: typeStr,
},
},
Expand All @@ -104,7 +104,7 @@ func TestFactory_CreateTraceExporterFails(t *testing.T) {
name: "invalid_url",
config: &Config{
ExporterSettings: configmodels.ExporterSettings{
TypeVal: typeStr,
TypeVal: configmodels.Type(typeStr),
NameVal: typeStr,
},
URL: ".localhost:123",
Expand All @@ -115,7 +115,7 @@ func TestFactory_CreateTraceExporterFails(t *testing.T) {
name: "negative_duration",
config: &Config{
ExporterSettings: configmodels.ExporterSettings{
TypeVal: typeStr,
TypeVal: configmodels.Type(typeStr),
NameVal: typeStr,
},
URL: "localhost:123",
Expand Down
Loading