From bbbd3ba055cb6854b6769f0c31454a3d198924f5 Mon Sep 17 00:00:00 2001 From: Raj Kamal Singh <1133322+raj-k-singh@users.noreply.github.com> Date: Mon, 2 Dec 2024 15:48:56 +0530 Subject: [PATCH] fix: signozawsfirehose receiver: fix broken tests (#468) Co-authored-by: Vibhu Pandey --- receiver/signozawsfirehosereceiver/README.md | 2 +- receiver/signozawsfirehosereceiver/factory.go | 2 +- .../signozawsfirehosereceiver/generated_component_test.go | 2 +- receiver/signozawsfirehosereceiver/receiver_test.go | 2 +- .../signozawsfirehosereceiver/testdata/cwlogs_config.yaml | 2 +- .../signozawsfirehosereceiver/testdata/cwmetrics_config.yaml | 2 +- .../signozawsfirehosereceiver/testdata/invalid_config.yaml | 4 ++-- .../signozawsfirehosereceiver/testdata/otlp_v1_config.yaml | 2 +- 8 files changed, 9 insertions(+), 9 deletions(-) diff --git a/receiver/signozawsfirehosereceiver/README.md b/receiver/signozawsfirehosereceiver/README.md index 3925175b..d55c16b5 100644 --- a/receiver/signozawsfirehosereceiver/README.md +++ b/receiver/signozawsfirehosereceiver/README.md @@ -28,7 +28,7 @@ using a Load Balancer. ### endpoint: The address:port to bind the listener to. -default: `localhost:4433` +default: `0.0.0.0:4433` You can temporarily disable the `component.UseLocalHostAsDefaultHost` feature gate to change this to `0.0.0.0:4433`. This feature gate will be removed in a future release. diff --git a/receiver/signozawsfirehosereceiver/factory.go b/receiver/signozawsfirehosereceiver/factory.go index 74ae1314..3a7e87c1 100644 --- a/receiver/signozawsfirehosereceiver/factory.go +++ b/receiver/signozawsfirehosereceiver/factory.go @@ -78,7 +78,7 @@ func defaultLogsUnmarshalers(logger *zap.Logger) map[string]unmarshaler.LogsUnma func createDefaultConfig() component.Config { return &Config{ ServerConfig: confighttp.ServerConfig{ - Endpoint: fmt.Sprintf("localhost:%d", defaultPort), + Endpoint: fmt.Sprintf("0.0.0.0:%d", defaultPort), }, } } diff --git a/receiver/signozawsfirehosereceiver/generated_component_test.go b/receiver/signozawsfirehosereceiver/generated_component_test.go index 6ba82df2..03a1aa63 100644 --- a/receiver/signozawsfirehosereceiver/generated_component_test.go +++ b/receiver/signozawsfirehosereceiver/generated_component_test.go @@ -16,7 +16,7 @@ import ( ) func TestComponentFactoryType(t *testing.T) { - require.Equal(t, "awsfirehose", NewFactory().Type().String()) + require.Equal(t, "signozawsfirehose", NewFactory().Type().String()) } func TestComponentConfigStruct(t *testing.T) { diff --git a/receiver/signozawsfirehosereceiver/receiver_test.go b/receiver/signozawsfirehosereceiver/receiver_test.go index e682d87c..badc8936 100644 --- a/receiver/signozawsfirehosereceiver/receiver_test.go +++ b/receiver/signozawsfirehosereceiver/receiver_test.go @@ -147,7 +147,7 @@ func TestFirehoseRequest(t *testing.T) { "WithInvalidBody": { body: "{ test: ", wantStatusCode: http.StatusBadRequest, - wantErr: errors.New("json: cannot unmarshal string into Go value of type awsfirehosereceiver.firehoseRequest"), + wantErr: errors.New("json: cannot unmarshal string into Go value of type signozawsfirehosereceiver.firehoseRequest"), }, "WithNoRecords": { body: testFirehoseRequest(testFirehoseRequestID, noRecords), diff --git a/receiver/signozawsfirehosereceiver/testdata/cwlogs_config.yaml b/receiver/signozawsfirehosereceiver/testdata/cwlogs_config.yaml index 9ec04ad0..a1833478 100644 --- a/receiver/signozawsfirehosereceiver/testdata/cwlogs_config.yaml +++ b/receiver/signozawsfirehosereceiver/testdata/cwlogs_config.yaml @@ -1,4 +1,4 @@ -awsfirehose: +signozawsfirehose: endpoint: 0.0.0.0:4433 record_type: cwlogs access_key: "some_access_key" diff --git a/receiver/signozawsfirehosereceiver/testdata/cwmetrics_config.yaml b/receiver/signozawsfirehosereceiver/testdata/cwmetrics_config.yaml index 13dbc9fe..90b1565e 100644 --- a/receiver/signozawsfirehosereceiver/testdata/cwmetrics_config.yaml +++ b/receiver/signozawsfirehosereceiver/testdata/cwmetrics_config.yaml @@ -1,4 +1,4 @@ -awsfirehose: +signozawsfirehose: endpoint: 0.0.0.0:4433 record_type: cwmetrics access_key: "some_access_key" diff --git a/receiver/signozawsfirehosereceiver/testdata/invalid_config.yaml b/receiver/signozawsfirehosereceiver/testdata/invalid_config.yaml index 17ad1316..d9d94e78 100644 --- a/receiver/signozawsfirehosereceiver/testdata/invalid_config.yaml +++ b/receiver/signozawsfirehosereceiver/testdata/invalid_config.yaml @@ -1,3 +1,3 @@ -awsfirehose: +signozawsfirehose: endpoint: 0.0.0.0:4433 - record_type: invalid \ No newline at end of file + record_type: invalid diff --git a/receiver/signozawsfirehosereceiver/testdata/otlp_v1_config.yaml b/receiver/signozawsfirehosereceiver/testdata/otlp_v1_config.yaml index fe9def7f..2254471c 100644 --- a/receiver/signozawsfirehosereceiver/testdata/otlp_v1_config.yaml +++ b/receiver/signozawsfirehosereceiver/testdata/otlp_v1_config.yaml @@ -1,4 +1,4 @@ -awsfirehose: +signozawsfirehose: endpoint: 0.0.0.0:4433 record_type: otlp_v1 access_key: "some_access_key"