Skip to content

Commit 7a4f6a8

Browse files
author
Paulo Janotti
committed
Rename endpoint to http-url and related field
1 parent 4358e0d commit 7a4f6a8

File tree

7 files changed

+15
-15
lines changed

7 files changed

+15
-15
lines changed

examples/demotrace/otel-collector-config.yaml

+1-1
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ receivers:
88
exporters:
99
logging:
1010
zipkin:
11-
endpoint: "http://zipkin-all-in-one:9411/api/v2/spans"
11+
http-url: "http://zipkin-all-in-one:9411/api/v2/spans"
1212

1313
# TODO: enable jaeger exporter when it is implemented in otelsvc
1414
# jaeger:

exporter/README.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -27,13 +27,13 @@ Exports trace data to a [Zipkin](https://zipkin.io/) endpoint.
2727

2828
The following settings can be configured:
2929

30-
* `endpoint:` URL to which the exporter is going to send Zipkin trace data. This
30+
* `http-url:` URL to which the exporter is going to send Zipkin trace data. This
3131
setting doesn't have a default value and must be specified in the configuration.
3232

3333
Example:
3434

3535
```yaml
3636
exporters:
3737
zipkin:
38-
endpoint: "http://some.url:9411/api/v2/spans"
38+
http-url: "http://some.url:9411/api/v2/spans"
3939
```

exporter/zipkinexporter/config.go

+2-2
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ import (
2222
type Config struct {
2323
configmodels.ExporterSettings `mapstructure:",squash"` // squash ensures fields are correctly decoded in embedded struct.
2424

25-
// Endpoint is the URL to send the Zipkin trace data to (e.g.:
25+
// HTTPAddress is the URL to send the Zipkin trace data to (e.g.:
2626
// http://some.url:9411/api/v2/spans).
27-
Endpoint string `mapstructure:"endpoint"`
27+
HTTPAddress string `mapstructure:"http-url"`
2828
}

exporter/zipkinexporter/config_test.go

+3-3
Original file line numberDiff line numberDiff line change
@@ -40,14 +40,14 @@ func TestLoadConfig(t *testing.T) {
4040

4141
e0 := cfg.Exporters["zipkin"]
4242

43-
// Endpoint doesn't have a default value so set it directly.
43+
// HTTPAddress doesn't have a default value so set it directly.
4444
defaultCfg := factory.CreateDefaultConfig().(*Config)
45-
defaultCfg.Endpoint = "http://some.location.org:9411/api/v2/spans"
45+
defaultCfg.HTTPAddress = "http://some.location.org:9411/api/v2/spans"
4646
assert.Equal(t, defaultCfg, e0)
4747

4848
e1 := cfg.Exporters["zipkin/2"]
4949
assert.Equal(t, "zipkin/2", e1.(*Config).Name())
50-
assert.Equal(t, "https://somedest:1234/api/v2/spans", e1.(*Config).Endpoint)
50+
assert.Equal(t, "https://somedest:1234/api/v2/spans", e1.(*Config).HTTPAddress)
5151
_, _, err = factory.CreateTraceExporter(zap.NewNop(), e1)
5252
require.NoError(t, err)
5353
}

exporter/zipkinexporter/factory.go

+3-3
Original file line numberDiff line numberDiff line change
@@ -52,8 +52,8 @@ func (f *Factory) CreateDefaultConfig() configmodels.Exporter {
5252
func (f *Factory) CreateTraceExporter(logger *zap.Logger, config configmodels.Exporter) (consumer.TraceConsumer, exporter.StopFunc, error) {
5353
cfg := config.(*Config)
5454

55-
if cfg.Endpoint == "" {
56-
return nil, nil, errors.New("exporter config requires an Endpoint") // TODO: better error
55+
if cfg.HTTPAddress == "" {
56+
return nil, nil, errors.New("exporter config requires a non-empty 'http-url'") // TODO: better error
5757
}
5858

5959
// 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
6262
// ze.PushTraceData,
6363
// exporterhelper.WithSpanName("otelsvc.exporter.Zipkin.ConsumeTraceData"),
6464
// exporterhelper.WithRecordMetrics(true))
65-
ze, err := newZipkinExporter(cfg.Endpoint, "<missing service name>", 0)
65+
ze, err := newZipkinExporter(cfg.HTTPAddress, "<missing service name>", 0)
6666
if err != nil {
6767
return nil, nil, err
6868
}

exporter/zipkinexporter/factory_test.go

+2-2
Original file line numberDiff line numberDiff line change
@@ -51,9 +51,9 @@ func TestCreateInstanceViaFactory(t *testing.T) {
5151
assert.Nil(t, ze)
5252
assert.Nil(t, zeStopFn)
5353

54-
// Endpoint doesn't have a default value so set it directly.
54+
// HTTPAddress doesn't have a default value so set it directly.
5555
zeCfg := cfg.(*Config)
56-
zeCfg.Endpoint = "http://some.location.org:9411/api/v2/spans"
56+
zeCfg.HTTPAddress = "http://some.location.org:9411/api/v2/spans"
5757
ze, zeStopFn, err = factory.CreateTraceExporter(
5858
zap.NewNop(),
5959
cfg)

exporter/zipkinexporter/testdata/config.yaml

+2-2
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,9 @@ processors:
66

77
exporters:
88
zipkin:
9-
endpoint: "http://some.location.org:9411/api/v2/spans"
9+
http-url: "http://some.location.org:9411/api/v2/spans"
1010
zipkin/2:
11-
endpoint: "https://somedest:1234/api/v2/spans"
11+
http-url: "https://somedest:1234/api/v2/spans"
1212

1313
pipelines:
1414
traces:

0 commit comments

Comments
 (0)