Skip to content

Commit

Permalink
Remove the OTLP receiver legacy gRPC port references (open-telemetry#293
Browse files Browse the repository at this point in the history
)
  • Loading branch information
mxiamxia authored and hero committed Dec 12, 2021
1 parent 040f571 commit f147028
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 11 deletions.
10 changes: 2 additions & 8 deletions pkg/collector/parser/receiver_otlp.go
Original file line number Diff line number Diff line change
Expand Up @@ -27,9 +27,8 @@ var _ ReceiverParser = &OTLPReceiverParser{}
const (
parserNameOTLP = "__otlp"

defaultOTLPGRPCPort int32 = 4317
defaultOTLPGRPCLegacyPort int32 = 55680
defaultOTLPHTTPPort int32 = 55681
defaultOTLPGRPCPort int32 = 4317
defaultOTLPHTTPPort int32 = 55681
)

// OTLPReceiverParser parses the configuration for OTLP receivers.
Expand Down Expand Up @@ -71,11 +70,6 @@ func (o *OTLPReceiverParser) Ports() ([]corev1.ServicePort, error) {
Port: defaultOTLPGRPCPort,
TargetPort: intstr.FromInt(int(defaultOTLPGRPCPort)),
},
{
Name: portName(fmt.Sprintf("%s-grpc-legacy", o.name), defaultOTLPGRPCLegacyPort),
Port: defaultOTLPGRPCLegacyPort,
TargetPort: intstr.FromInt(int(defaultOTLPGRPCPort)), // we target the official port, not the legacy
},
},
},
{
Expand Down
5 changes: 2 additions & 3 deletions pkg/collector/parser/receiver_otlp_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -64,16 +64,15 @@ func TestOTLPExposeDefaultPorts(t *testing.T) {
portNumber int32
seen bool
}{
"otlp-grpc": {portNumber: 4317},
"otlp-grpc-legacy": {portNumber: 55680},
"otlp-grpc": {portNumber: 4317},
}

// test
ports, err := builder.Ports()

// verify
assert.NoError(t, err)
assert.Len(t, ports, 2)
assert.Len(t, ports, 1)

for _, port := range ports {
r := expectedResults[port.Name]
Expand Down

0 comments on commit f147028

Please sign in to comment.