Skip to content

Commit 968d4b8

Browse files
authored
[all] Promote component.UseLocalHostAsDefaultHost feature gate to beta (#33658)
**Description:** <Describe what has changed.> <!--Ex. Fixing a bug - Describe the bug and how this fixes the issue. Ex. Adding a feature - Explain what this achieves.--> Counterpart to open-telemetry/opentelemetry-collector/pull/10352. **Link to tracking Issue:** open-telemetry/opentelemetry-collector/issues/8510
1 parent c641095 commit 968d4b8

File tree

43 files changed

+143
-81
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

43 files changed

+143
-81
lines changed

.chloggen/mx-psi_localhost-fg.yaml

Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
# Use this changelog template to create an entry for release notes.
2+
# One of 'breaking', 'deprecation', 'new_component', 'enhancement', 'bug_fix'
3+
change_type: breaking
4+
5+
# The name of the component, or a single word describing the area of concern, (e.g. filelogreceiver)
6+
component: all
7+
8+
# A brief description of the change. Surround your text with quotes ("") if it needs to start with a backtick (`).
9+
note: "Promote `component.UseLocalHostAsDefaultHost` feature gate to beta. This changes default endpoints from 0.0.0.0 to localhost"
10+
11+
# Mandatory: One or more tracking issues related to the change. You can use the PR number here if no issue exists.
12+
issues: [30702]
13+
14+
# (Optional) One or more lines of additional information to render under the primary note.
15+
# These lines will be padded with 2 spaces and then inserted directly into the document.
16+
# Use pipe (|) for multiline entries.
17+
subtext: |
18+
This change affects the following components:
19+
- extension/awsproxy
20+
- extension/health_check
21+
- extension/health_checkv2
22+
- extension/jaegerremotesampling
23+
- internal/aws/proxy
24+
- processor/remotetap
25+
- receiver/awsfirehose
26+
- receiver/awsxray
27+
- receiver/influxdb
28+
- receiver/jaeger
29+
- receiver/loki
30+
- receiver/opencensus
31+
- receiver/sapm
32+
- receiver/signalfx
33+
- receiver/skywalking
34+
- receiver/splunk_hec
35+
- receiver/zipkin
36+
- receiver/zookeeper
37+
38+
# If your change doesn't affect end users or the exported elements of any package,
39+
# you should instead start your pull request title with [chore] or use the "Skip Changelog" label.
40+
# Optional: The change log or logs in which this entry should be included.
41+
# e.g. '[user]' or '[user, api]'
42+
# Include 'user' if the change is relevant to end users.
43+
# Include 'api' if there is a change to a library API.
44+
# Default: '[user]'
45+
change_logs: []

extension/awsproxy/README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -39,9 +39,9 @@ extensions:
3939
### endpoint (Optional)
4040
The TCP address and port on which this proxy listens for requests.
4141
42-
Default: `0.0.0.0:2000`
42+
Default: `localhost:2000`
4343

44-
The `component.UseLocalHostAsDefaultHost` feature gate changes this to localhost:2000. This will become the default in a future release.
44+
You can temporarily disable the `component.UseLocalHostAsDefaultHost` feature gate to change this to `0.0.0.0:2000`. This feature gate will be removed in a future release.
4545

4646

4747
### proxy_address (Optional)

extension/awsproxy/factory_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ func TestFactory_CreateDefaultConfig(t *testing.T) {
2828
assert.Equal(t, &Config{
2929
ProxyConfig: proxy.Config{
3030
TCPAddrConfig: confignet.TCPAddrConfig{
31-
Endpoint: "0.0.0.0:2000",
31+
Endpoint: "localhost:2000",
3232
},
3333
},
3434
}, cfg)

extension/healthcheckextension/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ liveness and/or readiness probe on Kubernetes.
2828

2929
The following settings are required:
3030

31-
- `endpoint` (default = 0.0.0.0:13133): Address to publish the health check status. For full list of `ServerConfig` refer [here](https://github.com/open-telemetry/opentelemetry-collector/tree/main/config/confighttp). The `component.UseLocalHostAsDefaultHost` feature gate changes this to localhost:13133. This will become the default in a future release.
31+
- `endpoint` (default = localhost:13133): Address to publish the health check status. For full list of `ServerConfig` refer [here](https://github.com/open-telemetry/opentelemetry-collector/tree/main/config/confighttp). You can temporarily disable the `component.UseLocalHostAsDefaultHost` feature gate to change this to 0.0.0.0:13133. This feature gate will be removed in a future release.
3232
- `path` (default = "/"): Specifies the path to be configured for the health check server.
3333
- `response_body` (default = ""): Specifies a static body that overrides the default response returned by the health check service.
3434

extension/healthcheckextension/factory_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ func TestFactory_CreateDefaultConfig(t *testing.T) {
2020
cfg := createDefaultConfig()
2121
assert.Equal(t, &Config{
2222
ServerConfig: confighttp.ServerConfig{
23-
Endpoint: "0.0.0.0:13133",
23+
Endpoint: "localhost:13133",
2424
},
2525
CheckCollectorPipeline: defaultCheckCollectorPipelineSettings(),
2626
Path: "/",

extension/healthcheckv2extension/README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ liveness and/or readiness probe on Kubernetes.
3838

3939
The following settings are required:
4040

41-
- `endpoint` (default = 0.0.0.0:13133): Address to publish the health check status. For full list of `ServerConfig` refer [here](https://github.com/open-telemetry/opentelemetry-collector/tree/main/config/confighttp). The `component.UseLocalHostAsDefaultHost` feature gate changes this to localhost:13133. This will become the default in a future release.
41+
- `endpoint` (default = localhost:13133): Address to publish the health check status. For full list of `ServerConfig` refer [here](https://github.com/open-telemetry/opentelemetry-collector/tree/main/config/confighttp). You can temporarily disable the `component.UseLocalHostAsDefaultHost` feature gate to change this to 0.0.0.0:13133. This feature gate will be removed in a future release.
4242
- `path` (default = "/"): Specifies the path to be configured for the health check server.
4343
- `response_body` (default = ""): Specifies a static body that overrides the default response returned by the health check service.
4444
- `check_collector_pipeline:` (deprecated and ignored): Settings of collector pipeline health check
@@ -425,4 +425,4 @@ begin streaming.
425425
There are plans to provide the ability to export status events as OTLP logs adhering to the event
426426
semantic conventions.
427427

428-
[grpc_health_v1 service]: https://github.com/grpc/grpc-proto/blob/master/grpc/health/v1/health.proto
428+
[grpc_health_v1 service]: https://github.com/grpc/grpc-proto/blob/master/grpc/health/v1/health.proto

extension/jaegerremotesampling/README.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,10 +14,10 @@
1414
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.
1515

1616
By default, two listeners are made available:
17-
- `0.0.0.0:5778`, following the legacy remote sampling endpoint as defined by Jaeger
18-
- `0.0.0.0:14250`, following the gRPC remote sampling endpoint, also defined by Jaeger
17+
- `localhost:5778`, following the legacy remote sampling endpoint as defined by Jaeger
18+
- `localhost:14250`, following the gRPC remote sampling endpoint, also defined by Jaeger
1919

20-
The `component.UseLocalHostAsDefaultHost` feature gate changes this to localhost:9943. This will become the default in a future release.
20+
You can temporarily disable the `component.UseLocalHostAsDefaultHost` feature gate to change this to `0.0.0.0:5778` and `0.0.0.0:14250` respectively. This feature gate will be removed in a future release.
2121

2222

2323
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.

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.ServerConfig{Endpoint: "0.0.0.0:5778"},
32+
HTTPServerConfig: &confighttp.ServerConfig{Endpoint: "localhost:5778"},
3333
GRPCServerConfig: &configgrpc.ServerConfig{NetAddr: confignet.AddrConfig{
34-
Endpoint: "0.0.0.0:14250",
34+
Endpoint: "localhost:14250",
3535
Transport: confignet.TransportTypeTCP,
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.ServerConfig{Endpoint: "0.0.0.0:5778"},
47+
HTTPServerConfig: &confighttp.ServerConfig{Endpoint: "localhost:5778"},
4848
GRPCServerConfig: &configgrpc.ServerConfig{NetAddr: confignet.AddrConfig{
49-
Endpoint: "0.0.0.0:14250",
49+
Endpoint: "localhost:14250",
5050
Transport: confignet.TransportTypeTCP,
5151
}},
5252
Source: Source{

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.ServerConfig{Endpoint: "0.0.0.0:5778"},
21+
HTTPServerConfig: &confighttp.ServerConfig{Endpoint: "localhost:5778"},
2222
GRPCServerConfig: &configgrpc.ServerConfig{NetAddr: confignet.AddrConfig{
23-
Endpoint: "0.0.0.0:14250",
23+
Endpoint: "localhost:14250",
2424
Transport: confignet.TransportTypeTCP,
2525
}},
2626
}

internal/common/localhostgate/featuregate.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ const UseLocalHostAsDefaultHostID = "component.UseLocalHostAsDefaultHost"
2323
var UseLocalHostAsDefaultHostfeatureGate = mustRegisterOrLoad(
2424
featuregate.GlobalRegistry(),
2525
UseLocalHostAsDefaultHostID,
26-
featuregate.StageAlpha,
26+
featuregate.StageBeta,
2727
featuregate.WithRegisterDescription("controls whether server-like receivers and extensions such as the OTLP receiver use localhost as the default host for their endpoints"),
2828
)
2929

@@ -60,8 +60,8 @@ func EndpointForPort(port int) string {
6060
// LogAboutUseLocalHostAsDefault logs about the upcoming change from 0.0.0.0 to localhost on server-like components.
6161
func LogAboutUseLocalHostAsDefault(logger *zap.Logger) {
6262
if !UseLocalHostAsDefaultHostfeatureGate.IsEnabled() {
63-
logger.Warn(
64-
"The default endpoints for all servers in components will change to use localhost instead of 0.0.0.0 in a future version. Use the feature gate to preview the new default.",
63+
logger.Info(
64+
"The default endpoints for all servers in components have changed to use localhost instead of 0.0.0.0. Use the feature gate to temporarily revert to the previous default.",
6565
zap.String("feature gate ID", UseLocalHostAsDefaultHostID),
6666
)
6767
}

0 commit comments

Comments
 (0)