@@ -18,9 +18,9 @@ import (
18
18
19
19
const UseLocalHostAsDefaultHostID = "component.UseLocalHostAsDefaultHost"
20
20
21
- // useLocalHostAsDefaultHostfeatureGate is the feature gate that controls whether
21
+ // UseLocalHostAsDefaultHostfeatureGate is the feature gate that controls whether
22
22
// server-like receivers and extensions such as the OTLP receiver use localhost as the default host for their endpoints.
23
- var useLocalHostAsDefaultHostfeatureGate = mustRegisterOrLoad (
23
+ var UseLocalHostAsDefaultHostfeatureGate = mustRegisterOrLoad (
24
24
featuregate .GlobalRegistry (),
25
25
UseLocalHostAsDefaultHostID ,
26
26
featuregate .StageAlpha ,
@@ -51,15 +51,15 @@ func mustRegisterOrLoad(reg *featuregate.Registry, id string, stage featuregate.
51
51
// EndpointForPort gets the endpoint for a given port using localhost or 0.0.0.0 depending on the feature gate.
52
52
func EndpointForPort (port int ) string {
53
53
host := "localhost"
54
- if ! useLocalHostAsDefaultHostfeatureGate .IsEnabled () {
54
+ if ! UseLocalHostAsDefaultHostfeatureGate .IsEnabled () {
55
55
host = "0.0.0.0"
56
56
}
57
57
return fmt .Sprintf ("%s:%d" , host , port )
58
58
}
59
59
60
60
// LogAboutUseLocalHostAsDefault logs about the upcoming change from 0.0.0.0 to localhost on server-like components.
61
61
func LogAboutUseLocalHostAsDefault (logger * zap.Logger ) {
62
- if ! useLocalHostAsDefaultHostfeatureGate .IsEnabled () {
62
+ if ! UseLocalHostAsDefaultHostfeatureGate .IsEnabled () {
63
63
logger .Warn (
64
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." ,
65
65
zap .String ("feature gate ID" , UseLocalHostAsDefaultHostID ),
0 commit comments