Skip to content

Commit 05c76dc

Browse files
atoulmemx-psi
authored andcommitted
[extension/jaegerremotesampling] jaegerremotesampling adopts component.UseLocalHostAsDefaultHost feature gate (open-telemetry#30983)
Description: jaegerremotesampling extension adopts component.UseLocalHostAsDefaultHost feature gate Link to tracking Issue: open-telemetry#30702 Fixes open-telemetry#30982 Documentation: Updated docs. Co-authored-by: Pablo Baeyens <[email protected]>
1 parent d491a1c commit 05c76dc

File tree

6 files changed

+18
-10
lines changed

6 files changed

+18
-10
lines changed

.chloggen/mx-psi_internal-localhostgate.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@ subtext: |
2727
- receiver/influxdb
2828
- receiver/zookeeper
2929
- receiver/signalfx
30+
- extension/jaegerremotesampling
3031
- receiver/jaeger
3132
- receiver/skywalking
3233

extension/jaegerremotesampling/README.md

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,11 @@
1717
This extension allows serving sampling strategies following the Jaeger's remote sampling API. This extension can be configured to proxy requests to a backing remote sampling server, which could potentially be a Jaeger Collector down the pipeline, or a static JSON file from the local file system.
1818

1919
By default, two listeners are made available:
20-
- `localhost:5778`, following the legacy remote sampling endpoint as defined by Jaeger
21-
- `localhost:14250`, following the gRPC remote sampling endpoint, also defined by Jaeger
20+
- `0.0.0.0:5778`, following the legacy remote sampling endpoint as defined by Jaeger
21+
- `0.0.0.0:14250`, following the gRPC remote sampling endpoint, also defined by Jaeger
22+
23+
The `component.UseLocalHostAsDefaultHost` feature gate changes this to localhost:9943. This will become the default in a future release.
24+
2225

2326
Note that the port `14250` will clash with the Jaeger Receiver. When both are used, it's recommended to change this extension to use another port.
2427

extension/jaegerremotesampling/config_test.go

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -29,9 +29,9 @@ func TestLoadConfig(t *testing.T) {
2929
{
3030
id: component.NewID(metadata.Type),
3131
expected: &Config{
32-
HTTPServerConfig: &confighttp.HTTPServerConfig{Endpoint: ":5778"},
32+
HTTPServerConfig: &confighttp.HTTPServerConfig{Endpoint: "0.0.0.0:5778"},
3333
GRPCServerSettings: &configgrpc.GRPCServerSettings{NetAddr: confignet.NetAddr{
34-
Endpoint: ":14250",
34+
Endpoint: "0.0.0.0:14250",
3535
Transport: "tcp",
3636
}},
3737
Source: Source{
@@ -44,9 +44,9 @@ func TestLoadConfig(t *testing.T) {
4444
{
4545
id: component.NewIDWithName(metadata.Type, "1"),
4646
expected: &Config{
47-
HTTPServerConfig: &confighttp.HTTPServerConfig{Endpoint: ":5778"},
47+
HTTPServerConfig: &confighttp.HTTPServerConfig{Endpoint: "0.0.0.0:5778"},
4848
GRPCServerSettings: &configgrpc.GRPCServerSettings{NetAddr: confignet.NetAddr{
49-
Endpoint: ":14250",
49+
Endpoint: "0.0.0.0:14250",
5050
Transport: "tcp",
5151
}},
5252
Source: Source{

extension/jaegerremotesampling/factory.go

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ import (
1616
"go.uber.org/zap"
1717

1818
"github.com/open-telemetry/opentelemetry-collector-contrib/extension/jaegerremotesampling/internal/metadata"
19+
"github.com/open-telemetry/opentelemetry-collector-contrib/internal/common/localhostgate"
1920
)
2021

2122
// NewFactory creates a factory for the jaeger remote sampling extension.
@@ -31,11 +32,11 @@ func NewFactory() extension.Factory {
3132
func createDefaultConfig() component.Config {
3233
return &Config{
3334
HTTPServerConfig: &confighttp.HTTPServerConfig{
34-
Endpoint: ":5778",
35+
Endpoint: localhostgate.EndpointForPort(5778),
3536
},
3637
GRPCServerSettings: &configgrpc.GRPCServerSettings{
3738
NetAddr: confignet.NetAddr{
38-
Endpoint: ":14250",
39+
Endpoint: localhostgate.EndpointForPort(14250),
3940
Transport: "tcp",
4041
},
4142
},

extension/jaegerremotesampling/factory_test.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,9 +18,9 @@ import (
1818
func TestCreateDefaultConfig(t *testing.T) {
1919
// prepare and test
2020
expected := &Config{
21-
HTTPServerConfig: &confighttp.HTTPServerConfig{Endpoint: ":5778"},
21+
HTTPServerConfig: &confighttp.HTTPServerConfig{Endpoint: "0.0.0.0:5778"},
2222
GRPCServerSettings: &configgrpc.GRPCServerSettings{NetAddr: confignet.NetAddr{
23-
Endpoint: ":14250",
23+
Endpoint: "0.0.0.0:14250",
2424
Transport: "tcp",
2525
}},
2626
}

extension/jaegerremotesampling/go.mod

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ go 1.20
55
require (
66
github.com/fortytw2/leaktest v1.3.0
77
github.com/jaegertracing/jaeger v1.53.0
8+
github.com/open-telemetry/opentelemetry-collector-contrib/internal/common v0.93.0
89
github.com/stretchr/testify v1.8.4
910
github.com/tilinna/clock v1.1.0
1011
go.opentelemetry.io/collector/component v0.93.1-0.20240130182548-89388addcc7f
@@ -90,3 +91,5 @@ retract (
9091
v0.76.1
9192
v0.65.0
9293
)
94+
95+
replace github.com/open-telemetry/opentelemetry-collector-contrib/internal/common => ../../internal/common

0 commit comments

Comments
 (0)