Skip to content

Commit

Permalink
Rename endpoint to http-url and related field
Browse files Browse the repository at this point in the history
  • Loading branch information
Paulo Janotti committed Jul 31, 2019
1 parent 4358e0d commit 7a4f6a8
Show file tree
Hide file tree
Showing 7 changed files with 15 additions and 15 deletions.
2 changes: 1 addition & 1 deletion examples/demotrace/otel-collector-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
4 changes: 2 additions & 2 deletions exporter/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,13 +27,13 @@ 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:

```yaml
exporters:
zipkin:
endpoint: "http://some.url:9411/api/v2/spans"
http-url: "http://some.url:9411/api/v2/spans"
```
4 changes: 2 additions & 2 deletions exporter/zipkinexporter/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -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"`
}
6 changes: 3 additions & 3 deletions exporter/zipkinexporter/config_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)
}
6 changes: 3 additions & 3 deletions exporter/zipkinexporter/factory.go
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand All @@ -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, "<missing service name>", 0)
ze, err := newZipkinExporter(cfg.HTTPAddress, "<missing service name>", 0)
if err != nil {
return nil, nil, err
}
Expand Down
4 changes: 2 additions & 2 deletions exporter/zipkinexporter/factory_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
4 changes: 2 additions & 2 deletions exporter/zipkinexporter/testdata/config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down

0 comments on commit 7a4f6a8

Please sign in to comment.