Skip to content

Commit

Permalink
Expose the OTLP HTTP port in the distributor service (#610)
Browse files Browse the repository at this point in the history
* Expose the OTLP HTTP port in the distributor service

Signed-off-by: Andreas Gerstmayr <agerstmayr@redhat.com>

* update e2e tests

Signed-off-by: Andreas Gerstmayr <agerstmayr@redhat.com>

---------

Signed-off-by: Andreas Gerstmayr <agerstmayr@redhat.com>
  • Loading branch information
andreasgerstmayr authored Sep 19, 2023
1 parent 7de4796 commit 43fbf44
Show file tree
Hide file tree
Showing 6 changed files with 51 additions and 0 deletions.
16 changes: 16 additions & 0 deletions .chloggen/otlp_http.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
# One of 'breaking', 'deprecation', 'new_component', 'enhancement', 'bug_fix'
change_type: enhancement

# The name of the component, or a single word describing the area of concern, (e.g. operator, github action)
component: operator

# A brief description of the change. Surround your text with quotes ("") if it needs to start with a backtick (`).
note: Expose the OTLP HTTP port in the distributor service.

# One or more tracking issues related to the change
issues: [610]

# (Optional) One or more lines of additional information to render under the primary note.
# These lines will be padded with 2 spaces and then inserted directly into the document.
# Use pipe (|) for multiline entries.
subtext:
11 changes: 11 additions & 0 deletions internal/manifests/distributor/distributor.go
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,11 @@ func deployment(params manifestutils.Params) *v1.Deployment {

if !tempo.Spec.Template.Gateway.Enabled {
containerPorts = append(containerPorts, []corev1.ContainerPort{
{
Name: manifestutils.PortOtlpHttpName,
ContainerPort: manifestutils.PortOtlpHttp,
Protocol: corev1.ProtocolTCP,
},
{
Name: manifestutils.PortJaegerThriftHTTPName,
ContainerPort: manifestutils.PortJaegerThriftHTTP,
Expand Down Expand Up @@ -187,6 +192,12 @@ func service(tempo v1alpha1.TempoStack) *corev1.Service {

if !tempo.Spec.Template.Gateway.Enabled {
servicePorts = append(servicePorts, []corev1.ServicePort{
{
Name: manifestutils.PortOtlpHttpName,
Port: manifestutils.PortOtlpHttp,
TargetPort: intstr.FromString(manifestutils.PortOtlpHttpName),
Protocol: corev1.ProtocolTCP,
},
{
Name: manifestutils.PortJaegerThriftHTTPName,
Port: manifestutils.PortJaegerThriftHTTP,
Expand Down
11 changes: 11 additions & 0 deletions internal/manifests/distributor/distributor_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,11 @@ func TestBuildDistributor(t *testing.T) {
ContainerPort: manifestutils.PortMemberlist,
Protocol: corev1.ProtocolTCP,
},
{
Name: manifestutils.PortOtlpHttpName,
ContainerPort: manifestutils.PortOtlpHttp,
Protocol: corev1.ProtocolTCP,
},
{
Name: manifestutils.PortJaegerThriftHTTPName,
ContainerPort: manifestutils.PortJaegerThriftHTTP,
Expand Down Expand Up @@ -85,6 +90,12 @@ func TestBuildDistributor(t *testing.T) {
Port: manifestutils.PortHTTPServer,
TargetPort: intstr.FromString(manifestutils.HttpPortName),
},
{
Name: manifestutils.PortOtlpHttpName,
Port: manifestutils.PortOtlpHttp,
TargetPort: intstr.FromString(manifestutils.PortOtlpHttpName),
Protocol: corev1.ProtocolTCP,
},
{
Name: manifestutils.PortJaegerThriftHTTPName,
Port: manifestutils.PortJaegerThriftHTTP,
Expand Down
5 changes: 5 additions & 0 deletions internal/manifests/manifestutils/constants.go
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,11 @@ const (
// PortOtlpGrpcServer declares the port number of the OpenTelemetry Collector gRPC receiver port.
PortOtlpGrpcServer = 4317

// PortOtlpHttpName declares the port name of the OpenTelemetry protocol over HTTP.
PortOtlpHttpName = "otlp-http"
// PortOtlpHttp declares the port number of the OpenTelemetry protocol over HTTP.
PortOtlpHttp = 4318

// PortJaegerThriftHTTPName declares the port name of the Jaeger Thrift HTTP protocol.
PortJaegerThriftHTTPName = "thrift-http"
// PortJaegerThriftHTTP declares the port number of the Jaeger Thrift HTTP protocol.
Expand Down
4 changes: 4 additions & 0 deletions tests/e2e/generate/01-assert.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,10 @@ spec:
port: 3200
protocol: TCP
targetPort: http
- name: otlp-http
port: 4318
protocol: TCP
targetPort: otlp-http
- name: thrift-http
port: 14268
protocol: TCP
Expand Down
4 changes: 4 additions & 0 deletions tests/e2e/smoketest-with-jaeger/01-assert.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -165,6 +165,10 @@ spec:
port: 3200
protocol: TCP
targetPort: http
- name: otlp-http
port: 4318
protocol: TCP
targetPort: otlp-http
- name: thrift-http
port: 14268
protocol: TCP
Expand Down

0 comments on commit 43fbf44

Please sign in to comment.