File tree Expand file tree Collapse file tree 5 files changed +11
-8
lines changed Expand file tree Collapse file tree 5 files changed +11
-8
lines changed Original file line number Diff line number Diff line change @@ -27,6 +27,7 @@ subtext: |
27
27
- receiver/influxdb
28
28
- receiver/zookeeper
29
29
- receiver/signalfx
30
+ - receiver/sapm
30
31
- extension/jaegerremotesampling
31
32
- receiver/jaeger
32
33
- receiver/skywalking
Original file line number Diff line number Diff line change @@ -26,6 +26,7 @@ The following settings are required:
26
26
27
27
- ` endpoint ` (default = ` 0.0.0.0:7276 ` ): Address and port that the SAPM
28
28
receiver should bind to.
29
+ The ` component.UseLocalHostAsDefaultHost ` feature gate changes this to localhost:7276. This will become the default in a future release.
29
30
30
31
The following setting are optional:
31
32
Original file line number Diff line number Diff line change @@ -44,7 +44,7 @@ func TestLoadConfig(t *testing.T) {
44
44
id : component .NewIDWithName (metadata .Type , "tls" ),
45
45
expected : & Config {
46
46
HTTPServerConfig : confighttp.HTTPServerConfig {
47
- Endpoint : ":7276" ,
47
+ Endpoint : "0.0.0.0 :7276" ,
48
48
TLSSetting : & configtls.TLSServerSetting {
49
49
TLSSetting : configtls.TLSSetting {
50
50
CertFile : "/test.crt" ,
@@ -58,7 +58,7 @@ func TestLoadConfig(t *testing.T) {
58
58
id : component .NewIDWithName (metadata .Type , "passthrough" ),
59
59
expected : & Config {
60
60
HTTPServerConfig : confighttp.HTTPServerConfig {
61
- Endpoint : ":7276" ,
61
+ Endpoint : "0.0.0.0 :7276" ,
62
62
},
63
63
AccessTokenPassthroughConfig : splunk.AccessTokenPassthroughConfig {
64
64
AccessTokenPassthrough : true ,
Original file line number Diff line number Diff line change @@ -16,12 +16,13 @@ import (
16
16
"go.opentelemetry.io/collector/consumer"
17
17
"go.opentelemetry.io/collector/receiver"
18
18
19
+ "github.com/open-telemetry/opentelemetry-collector-contrib/internal/common/localhostgate"
19
20
"github.com/open-telemetry/opentelemetry-collector-contrib/receiver/sapmreceiver/internal/metadata"
20
21
)
21
22
22
23
const (
23
- // Default endpoints to bind to.
24
- defaultEndpoint = ": 7276"
24
+ // Default port to bind to.
25
+ defaultPort = 7276
25
26
)
26
27
27
28
// NewFactory creates a factory for SAPM receiver.
@@ -35,7 +36,7 @@ func NewFactory() receiver.Factory {
35
36
func createDefaultConfig () component.Config {
36
37
return & Config {
37
38
HTTPServerConfig : confighttp.HTTPServerConfig {
38
- Endpoint : defaultEndpoint ,
39
+ Endpoint : localhostgate . EndpointForPort ( defaultPort ) ,
39
40
},
40
41
}
41
42
}
Original file line number Diff line number Diff line change @@ -279,7 +279,7 @@ func TestReception(t *testing.T) {
279
279
// 1. Create the SAPM receiver aka "server"
280
280
config : & Config {
281
281
HTTPServerConfig : confighttp.HTTPServerConfig {
282
- Endpoint : defaultEndpoint ,
282
+ Endpoint : "0.0.0.0:7226" ,
283
283
},
284
284
},
285
285
sapm : & splunksapm.PostSpansRequest {Batches : []* model.Batch {grpcFixture (now )}},
@@ -293,7 +293,7 @@ func TestReception(t *testing.T) {
293
293
args : args {
294
294
config : & Config {
295
295
HTTPServerConfig : confighttp.HTTPServerConfig {
296
- Endpoint : defaultEndpoint ,
296
+ Endpoint : "0.0.0.0:7226" ,
297
297
},
298
298
},
299
299
sapm : & splunksapm.PostSpansRequest {Batches : []* model.Batch {grpcFixture (now )}},
@@ -382,7 +382,7 @@ func TestAccessTokenPassthrough(t *testing.T) {
382
382
t .Run (tt .name , func (t * testing.T ) {
383
383
config := & Config {
384
384
HTTPServerConfig : confighttp.HTTPServerConfig {
385
- Endpoint : defaultEndpoint ,
385
+ Endpoint : "0.0.0.0:7226" ,
386
386
},
387
387
AccessTokenPassthroughConfig : splunk.AccessTokenPassthroughConfig {
388
388
AccessTokenPassthrough : tt .accessTokenPassthrough ,
You can’t perform that action at this time.
0 commit comments