diff --git a/examples/demotrace/otel-collector-config.yaml b/examples/demotrace/otel-collector-config.yaml index 0e62f7dd243..6aa0c53cbd4 100644 --- a/examples/demotrace/otel-collector-config.yaml +++ b/examples/demotrace/otel-collector-config.yaml @@ -8,7 +8,7 @@ receivers: exporters: logging: zipkin: - endpoint: "http://zipkin-all-in-one:9411/api/v2/spans" + http-url: "http://zipkin-all-in-one:9411/api/v2/spans" # TODO: enable jaeger exporter when it is implemented in otelsvc # jaeger: diff --git a/exporter/README.md b/exporter/README.md index 53710c471b6..019079a9f3b 100644 --- a/exporter/README.md +++ b/exporter/README.md @@ -27,7 +27,7 @@ Exports trace data to a [Zipkin](https://zipkin.io/) endpoint. The following settings can be configured: -* `endpoint:` URL to which the exporter is going to send Zipkin trace data. This +* `http-url:` URL to which the exporter is going to send Zipkin trace data. This setting doesn't have a default value and must be specified in the configuration. Example: @@ -35,5 +35,5 @@ Example: ```yaml exporters: zipkin: - endpoint: "http://some.url:9411/api/v2/spans" + http-url: "http://some.url:9411/api/v2/spans" ``` diff --git a/exporter/zipkinexporter/config.go b/exporter/zipkinexporter/config.go index 5a6bb577e77..99919b72ee7 100644 --- a/exporter/zipkinexporter/config.go +++ b/exporter/zipkinexporter/config.go @@ -22,7 +22,7 @@ import ( type Config struct { configmodels.ExporterSettings `mapstructure:",squash"` // squash ensures fields are correctly decoded in embedded struct. - // Endpoint is the URL to send the Zipkin trace data to (e.g.: + // HTTPAddress is the URL to send the Zipkin trace data to (e.g.: // http://some.url:9411/api/v2/spans). - Endpoint string `mapstructure:"endpoint"` + HTTPAddress string `mapstructure:"http-url"` } diff --git a/exporter/zipkinexporter/config_test.go b/exporter/zipkinexporter/config_test.go index 3d1bedcf2fd..4531b413334 100644 --- a/exporter/zipkinexporter/config_test.go +++ b/exporter/zipkinexporter/config_test.go @@ -40,14 +40,14 @@ func TestLoadConfig(t *testing.T) { e0 := cfg.Exporters["zipkin"] - // Endpoint doesn't have a default value so set it directly. + // HTTPAddress doesn't have a default value so set it directly. defaultCfg := factory.CreateDefaultConfig().(*Config) - defaultCfg.Endpoint = "http://some.location.org:9411/api/v2/spans" + defaultCfg.HTTPAddress = "http://some.location.org:9411/api/v2/spans" assert.Equal(t, defaultCfg, e0) e1 := cfg.Exporters["zipkin/2"] assert.Equal(t, "zipkin/2", e1.(*Config).Name()) - assert.Equal(t, "https://somedest:1234/api/v2/spans", e1.(*Config).Endpoint) + assert.Equal(t, "https://somedest:1234/api/v2/spans", e1.(*Config).HTTPAddress) _, _, err = factory.CreateTraceExporter(zap.NewNop(), e1) require.NoError(t, err) } diff --git a/exporter/zipkinexporter/factory.go b/exporter/zipkinexporter/factory.go index 8d3f56e5c9d..a0a3d16a14d 100644 --- a/exporter/zipkinexporter/factory.go +++ b/exporter/zipkinexporter/factory.go @@ -52,8 +52,8 @@ func (f *Factory) CreateDefaultConfig() configmodels.Exporter { func (f *Factory) CreateTraceExporter(logger *zap.Logger, config configmodels.Exporter) (consumer.TraceConsumer, exporter.StopFunc, error) { cfg := config.(*Config) - if cfg.Endpoint == "" { - return nil, nil, errors.New("exporter config requires an Endpoint") // TODO: better error + if cfg.HTTPAddress == "" { + return nil, nil, errors.New("exporter config requires a non-empty 'http-url'") // TODO: better error } // TODO: (@pjanotti) Move to code like the comment below in a separate PR. @@ -62,7 +62,7 @@ func (f *Factory) CreateTraceExporter(logger *zap.Logger, config configmodels.Ex // ze.PushTraceData, // exporterhelper.WithSpanName("otelsvc.exporter.Zipkin.ConsumeTraceData"), // exporterhelper.WithRecordMetrics(true)) - ze, err := newZipkinExporter(cfg.Endpoint, "", 0) + ze, err := newZipkinExporter(cfg.HTTPAddress, "", 0) if err != nil { return nil, nil, err } diff --git a/exporter/zipkinexporter/factory_test.go b/exporter/zipkinexporter/factory_test.go index af46145c004..f121870f461 100644 --- a/exporter/zipkinexporter/factory_test.go +++ b/exporter/zipkinexporter/factory_test.go @@ -51,9 +51,9 @@ func TestCreateInstanceViaFactory(t *testing.T) { assert.Nil(t, ze) assert.Nil(t, zeStopFn) - // Endpoint doesn't have a default value so set it directly. + // HTTPAddress doesn't have a default value so set it directly. zeCfg := cfg.(*Config) - zeCfg.Endpoint = "http://some.location.org:9411/api/v2/spans" + zeCfg.HTTPAddress = "http://some.location.org:9411/api/v2/spans" ze, zeStopFn, err = factory.CreateTraceExporter( zap.NewNop(), cfg) diff --git a/exporter/zipkinexporter/testdata/config.yaml b/exporter/zipkinexporter/testdata/config.yaml index 34f825918d6..f6d4dea9b6f 100644 --- a/exporter/zipkinexporter/testdata/config.yaml +++ b/exporter/zipkinexporter/testdata/config.yaml @@ -6,9 +6,9 @@ processors: exporters: zipkin: - endpoint: "http://some.location.org:9411/api/v2/spans" + http-url: "http://some.location.org:9411/api/v2/spans" zipkin/2: - endpoint: "https://somedest:1234/api/v2/spans" + http-url: "https://somedest:1234/api/v2/spans" pipelines: traces: