Documentation
¶
Overview ¶
package localhostgate defines a feature gate that controls whether server-like receivers and extensions use localhost as the default host for their endpoints. This package is duplicated across core and contrib to avoid exposing the feature gate as part of the public API. To do this we define a `registerOrLoad` helper and try to register the gate in both modules. IMPORTANT NOTE: ANY CHANGES TO THIS PACKAGE MUST BE MIRRORED IN THE CORE COUNTERPART. See https://github.com/open-telemetry/opentelemetry-collector/blob/main/internal/localhostgate/featuregate.go
Index ¶
Constants ¶
const UseLocalHostAsDefaultHostID = "component.UseLocalHostAsDefaultHost"
Variables ¶
var UseLocalHostAsDefaultHostfeatureGate = mustRegisterOrLoad( featuregate.GlobalRegistry(), UseLocalHostAsDefaultHostID, featuregate.StageBeta, featuregate.WithRegisterDescription("controls whether server-like receivers and extensions such as the OTLP receiver use localhost as the default host for their endpoints"), )
UseLocalHostAsDefaultHostfeatureGate is the feature gate that controls whether server-like receivers and extensions such as the OTLP receiver use localhost as the default host for their endpoints.
Functions ¶
func EndpointForPort ¶
EndpointForPort gets the endpoint for a given port using localhost or 0.0.0.0 depending on the feature gate.
func LogAboutUseLocalHostAsDefault ¶
LogAboutUseLocalHostAsDefault logs about the upcoming change from 0.0.0.0 to localhost on server-like components.
Types ¶
This section is empty.