Skip to content
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
14 changes: 13 additions & 1 deletion internal/gatewayapi/listener.go
Original file line number Diff line number Diff line change
Expand Up @@ -681,7 +681,12 @@ func (t *Translator) processAccessLog(envoyproxy *egv1a1.EnvoyProxy, resources *
if err != nil {
return nil, err
}
// TODO: remove support for Host/Port in v1.2

// EG currently support GRPC OTel only, change protocol to GRPC.
for _, d := range ds {
d.Protocol = ir.GRPC
}

al := &ir.OpenTelemetryAccessLog{
CELMatches: validExprs,
Resources: sink.OpenTelemetry.Resources,
Expand Down Expand Up @@ -738,6 +743,13 @@ func (t *Translator) processTracing(gw *gwapiv1.Gateway, envoyproxy *egv1a1.Envo
return nil, err
}

// EG currently support OTel tracing only, change protocol to GRPC.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

thanks, can we do the same for metrics and access logs as well

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

update for accesslog.
Metrics is [done].(

http2_protocol_options: {}
)

if tracing.Provider.Type == egv1a1.TracingProviderTypeOpenTelemetry {
for _, d := range ds {
d.Protocol = ir.GRPC
}
}

var authority string

// fallback to host and port
Expand Down
6 changes: 3 additions & 3 deletions internal/gatewayapi/testdata/accesslog-als-backend.out.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -168,7 +168,7 @@ xdsIR:
name: backend-uds
namespace: envoy-gateway
name: accesslog_otel_0_0/backend/-1
protocol: TCP
protocol: GRPC
- addressType: FQDN
endpoints:
- host: primary.foo.com
Expand All @@ -178,7 +178,7 @@ xdsIR:
name: backend-fqdn
namespace: envoy-gateway
name: accesslog_otel_0_0/backend/-1
protocol: HTTP2
protocol: GRPC
- addressType: IP
endpoints:
- host: 1.1.1.1
Expand All @@ -188,7 +188,7 @@ xdsIR:
name: backend-ip
namespace: envoy-gateway
name: accesslog_otel_0_0/backend/-1
protocol: TCP
protocol: GRPC
resources:
k8s.cluster.name: cluster-1
text: |
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -341,7 +341,7 @@ xdsIR:
namespace: default
sectionName: "8080"
name: accesslog_otel_0_1/backend/-1
protocol: TCP
protocol: GRPC
resources:
k8s.cluster.name: cluster-1
text: |
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -236,7 +236,7 @@ xdsIR:
name: datadog-svc
namespace: envoy-gateway-system
name: tracing/backend/-1
protocol: TCP
protocol: GRPC
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

can we also add a test case in xds lib as well

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

provider:
backendRefs:
- group: gateway.envoyproxy.io
Expand Down
62 changes: 61 additions & 1 deletion test/e2e/testdata/tracing-otel-custom-service-name.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ spec:
tracing:
provider:
backendRefs:
- name: otel-collector
- name: my-otel-collector
namespace: monitoring
port: 4317
serviceName: my-custom-service
Expand Down Expand Up @@ -72,3 +72,63 @@ spec:
backendRefs:
- name: infra-backend-v1
port: 8080
---
# This's generally a copy of otel-collector service
# with removing appProtocol from port 4317.
# this should be worked because we assure that OpenTelemetry
# running in GRPC.
apiVersion: v1
kind: Service
metadata:
name: my-otel-collector
namespace: monitoring
labels:
helm.sh/chart: opentelemetry-collector-0.117.3
app.kubernetes.io/name: opentelemetry-collector
app.kubernetes.io/instance: gateway-addons-helm
app.kubernetes.io/version: "0.120.0"
app.kubernetes.io/managed-by: Helm
app.kubernetes.io/component: standalone-collector
component: standalone-collector
spec:
type: ClusterIP
ports:

- name: datadog
port: 8126
targetPort: 8126
protocol: TCP
- name: envoy-als
port: 9000
targetPort: 9000
protocol: TCP
appProtocol: grpc
- name: jaeger-compact
port: 6831
targetPort: 6831
protocol: UDP
- name: jaeger-grpc
port: 14250
targetPort: 14250
protocol: TCP
- name: jaeger-thrift
port: 14268
targetPort: 14268
protocol: TCP
- name: otlp
port: 4317
targetPort: 4317
protocol: TCP
- name: otlp-http
port: 4318
targetPort: 4318
protocol: TCP
- name: zipkin
port: 9411
targetPort: 9411
protocol: TCP
selector:
app.kubernetes.io/instance: eg-addons
app.kubernetes.io/name: opentelemetry-collector
component: standalone-collector
internalTrafficPolicy: Cluster