Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[receiver/splunkhec] splunkhecreiver adopts `component.UseLocalHostAsDefaultHost feature gate` #30847

Merged
merged 2 commits into from
Jan 31, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .chloggen/mx-psi_internal-localhostgate.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ subtext: |
- receiver/zipkin
- receiver/awsfirehose
- processor/remotetap
- receiver/splunk_hec

# If your change doesn't affect end users or the exported elements of any package,
# you should instead start your pull request title with [chore] or use the "Skip Changelog" label.
Expand Down
2 changes: 2 additions & 0 deletions receiver/splunkhecreceiver/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,8 @@ The following settings are required:
* `endpoint` (default = `0.0.0.0:8088`): Address and port that the Splunk HEC
receiver should bind to.

The `component.UseLocalHostAsDefaultHost` feature gate changes this to localhost:8088. This will become the default in a future release.

The following settings are optional:

* `access_token_passthrough` (default = `false`): Whether to preserve incoming
Expand Down
2 changes: 1 addition & 1 deletion receiver/splunkhecreceiver/config_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ func TestLoadConfig(t *testing.T) {
id: component.NewIDWithName(metadata.Type, "tls"),
expected: &Config{
HTTPServerConfig: confighttp.HTTPServerConfig{
Endpoint: ":8088",
Endpoint: "0.0.0.0:8088",
TLSSetting: &configtls.TLSServerSetting{
TLSSetting: configtls.TLSSetting{
CertFile: "/test.crt",
Expand Down
5 changes: 3 additions & 2 deletions receiver/splunkhecreceiver/factory.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ import (
"go.opentelemetry.io/collector/receiver"
conventions "go.opentelemetry.io/collector/semconv/v1.6.1"

"github.com/open-telemetry/opentelemetry-collector-contrib/internal/common/localhostgate"
"github.com/open-telemetry/opentelemetry-collector-contrib/internal/sharedcomponent"
"github.com/open-telemetry/opentelemetry-collector-contrib/internal/splunk"
"github.com/open-telemetry/opentelemetry-collector-contrib/receiver/splunkhecreceiver/internal/metadata"
Expand All @@ -21,7 +22,7 @@ import (

const (
// Default endpoints to bind to.
defaultEndpoint = ":8088"
defaultPort = 8088
)

// NewFactory creates a factory for Splunk HEC receiver.
Expand All @@ -37,7 +38,7 @@ func NewFactory() receiver.Factory {
func createDefaultConfig() component.Config {
return &Config{
HTTPServerConfig: confighttp.HTTPServerConfig{
Endpoint: defaultEndpoint,
Endpoint: localhostgate.EndpointForPort(defaultPort),
},
AccessTokenPassthroughConfig: splunk.AccessTokenPassthroughConfig{},
HecToOtelAttrs: splunk.HecToOtelAttrs{
Expand Down
Loading