Skip to content

Commit

Permalink
fix(receiver-otlpreceiver): rename to make more sense to reduce verbo…
Browse files Browse the repository at this point in the history
…sity.
  • Loading branch information
Luiz Pegoraro committed Aug 11, 2023
1 parent 97069d1 commit df4b81e
Show file tree
Hide file tree
Showing 5 changed files with 15 additions and 15 deletions.
4 changes: 2 additions & 2 deletions receiver/otlpreceiver/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ const (
protoHTTP = "protocols::http"
)

type HTTPServerSettings struct {
type HTTPConfig struct {
*confighttp.HTTPServerSettings `mapstructure:",squash"`

// The URL path to receive traces on. If omitted "/v1/traces" will be used.
Expand All @@ -37,7 +37,7 @@ type HTTPServerSettings struct {
// Protocols is the configuration for the supported protocols.
type Protocols struct {
GRPC *configgrpc.GRPCServerSettings `mapstructure:"grpc"`
HTTP *HTTPServerSettings `mapstructure:"http"`
HTTP *HTTPConfig `mapstructure:"http"`
}

// Config defines configuration for OTLP receiver.
Expand Down
4 changes: 2 additions & 2 deletions receiver/otlpreceiver/config_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,7 @@ func TestUnmarshalConfig(t *testing.T) {
},
},
},
HTTP: &HTTPServerSettings{
HTTP: &HTTPConfig{
HTTPServerSettings: &confighttp.HTTPServerSettings{
Endpoint: "0.0.0.0:4318",
TLSSetting: &configtls.TLSServerSetting{
Expand Down Expand Up @@ -154,7 +154,7 @@ func TestUnmarshalConfigUnix(t *testing.T) {
},
ReadBufferSize: 512 * 1024,
},
HTTP: &HTTPServerSettings{
HTTP: &HTTPConfig{
HTTPServerSettings: &confighttp.HTTPServerSettings{
Endpoint: "/tmp/http_otlp.sock",
},
Expand Down
2 changes: 1 addition & 1 deletion receiver/otlpreceiver/factory.go
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ func createDefaultConfig() component.Config {
// We almost write 0 bytes, so no need to tune WriteBufferSize.
ReadBufferSize: 512 * 1024,
},
HTTP: &HTTPServerSettings{
HTTP: &HTTPConfig{
HTTPServerSettings: &confighttp.HTTPServerSettings{
Endpoint: defaultHTTPEndpoint,
},
Expand Down
14 changes: 7 additions & 7 deletions receiver/otlpreceiver/factory_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ func TestCreateTracesReceiver(t *testing.T) {
Transport: "tcp",
},
}
defaultHTTPSettings := &HTTPServerSettings{
defaultHTTPSettings := &HTTPConfig{
HTTPServerSettings: &confighttp.HTTPServerSettings{
Endpoint: testutil.GetAvailableLocalAddress(t),
},
Expand Down Expand Up @@ -94,7 +94,7 @@ func TestCreateTracesReceiver(t *testing.T) {
cfg: &Config{
Protocols: Protocols{
GRPC: defaultGRPCSettings,
HTTP: &HTTPServerSettings{
HTTP: &HTTPConfig{
HTTPServerSettings: &confighttp.HTTPServerSettings{
Endpoint: "localhost:112233",
},
Expand Down Expand Up @@ -132,7 +132,7 @@ func TestCreateMetricReceiver(t *testing.T) {
Transport: "tcp",
},
}
defaultHTTPSettings := &HTTPServerSettings{
defaultHTTPSettings := &HTTPConfig{
HTTPServerSettings: &confighttp.HTTPServerSettings{
Endpoint: testutil.GetAvailableLocalAddress(t),
},
Expand Down Expand Up @@ -175,7 +175,7 @@ func TestCreateMetricReceiver(t *testing.T) {
cfg: &Config{
Protocols: Protocols{
GRPC: defaultGRPCSettings,
HTTP: &HTTPServerSettings{
HTTP: &HTTPConfig{
HTTPServerSettings: &confighttp.HTTPServerSettings{
Endpoint: "327.0.0.1:1122",
},
Expand Down Expand Up @@ -212,7 +212,7 @@ func TestCreateLogReceiver(t *testing.T) {
Transport: "tcp",
},
}
defaultHTTPSettings := &HTTPServerSettings{
defaultHTTPSettings := &HTTPConfig{
HTTPServerSettings: &confighttp.HTTPServerSettings{
Endpoint: testutil.GetAvailableLocalAddress(t),
},
Expand Down Expand Up @@ -259,7 +259,7 @@ func TestCreateLogReceiver(t *testing.T) {
cfg: &Config{
Protocols: Protocols{
GRPC: defaultGRPCSettings,
HTTP: &HTTPServerSettings{
HTTP: &HTTPConfig{
HTTPServerSettings: &confighttp.HTTPServerSettings{
Endpoint: "327.0.0.1:1122",
},
Expand All @@ -275,7 +275,7 @@ func TestCreateLogReceiver(t *testing.T) {
cfg: &Config{
Protocols: Protocols{
GRPC: defaultGRPCSettings,
HTTP: &HTTPServerSettings{
HTTP: &HTTPConfig{
HTTPServerSettings: &confighttp.HTTPServerSettings{
Endpoint: "127.0.0.1:1122",
},
Expand Down
6 changes: 3 additions & 3 deletions receiver/otlpreceiver/otlp_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -201,7 +201,7 @@ func TestHandleInvalidRequests(t *testing.T) {
endpoint := testutil.GetAvailableLocalAddress(t)
cfg := &Config{
Protocols: Protocols{
HTTP: &HTTPServerSettings{
HTTP: &HTTPConfig{
HTTPServerSettings: &confighttp.HTTPServerSettings{
Endpoint: endpoint,
},
Expand Down Expand Up @@ -900,7 +900,7 @@ func TestGRPCMaxRecvSize(t *testing.T) {
func TestHTTPInvalidTLSCredentials(t *testing.T) {
cfg := &Config{
Protocols: Protocols{
HTTP: &HTTPServerSettings{
HTTP: &HTTPConfig{
HTTPServerSettings: &confighttp.HTTPServerSettings{
Endpoint: testutil.GetAvailableLocalAddress(t),
TLSSetting: &configtls.TLSServerSetting{
Expand Down Expand Up @@ -933,7 +933,7 @@ func testHTTPMaxRequestBodySizeJSON(t *testing.T, payload []byte, size int, expe
url := fmt.Sprintf("http://%s/v1/traces", endpoint)
cfg := &Config{
Protocols: Protocols{
HTTP: &HTTPServerSettings{
HTTP: &HTTPConfig{
HTTPServerSettings: &confighttp.HTTPServerSettings{
Endpoint: endpoint,
MaxRequestBodySize: int64(size),
Expand Down

0 comments on commit df4b81e

Please sign in to comment.