Skip to content

[CONTP-1782] Add appProtocol to OTLP gRPC services#3208

Merged
tbavelier merged 1 commit into
mainfrom
tbavelier/app-protocol-field
Jul 1, 2026
Merged

[CONTP-1782] Add appProtocol to OTLP gRPC services#3208
tbavelier merged 1 commit into
mainfrom
tbavelier/app-protocol-field

Conversation

@tbavelier

@tbavelier tbavelier commented Jul 1, 2026

Copy link
Copy Markdown
Member

What does this PR do?

Adds appProtocol: kubernetes.io/h2c to Service ports that expose OTLP/gRPC traffic:

  • Datadog Agent OTLP/gRPC local service port
  • OTel Agent standalone gRPC service port
  • OTel Agent Gateway gRPC service port

This intentionally leaves non-gRPC and OTLP/HTTP service ports unchanged.

Motivation

Fixes #2145.

Some gateways and service mesh integrations use ServicePort.appProtocol as a hint to configure upstream protocol handling. Without an HTTP/2 hint, OTLP/gRPC traffic can be proxied as HTTP/1.1 and fail with protocol errors.

This PR uses kubernetes.io/h2c instead of kgateway's http2 alias because it is the Kubernetes-defined appProtocol value for cleartext HTTP/2. OTLP/gRPC uses gRPC over HTTP/2, and these service ports are cleartext in-cluster endpoints, so kubernetes.io/h2c is both more explicit and more portable across Kubernetes-aware consumers.

References:

Additional Notes

appProtocol is only a protocol hint. It does not enforce traffic at the Kubernetes Service layer and does not change kube-proxy forwarding behavior.

Minimum Agent Versions

Are there minimum versions of the Datadog Agent and/or Cluster Agent required?

  • Agent: N/A
  • Cluster Agent: N/A

Describe your test plan

Deploy DDA with gateway and otelAgent enabled:

spec:
  features:
    otelAgentGateway:
      enabled: true
    otelCollector:
      enabled: true

Assert the Agent and gateway k8s services (note the service names might be different as they depend on your DatadogAgent name and override) expose the appProtocol kubernetes.io/h2c for the gRPC port 4317:

╰─❯ k describe svc datadog-agent-otel-agent-gateway
Name:                     datadog-agent-otel-agent-gateway
Namespace:                system
Labels:                   app.kubernetes.io/instance=datadog-agent
                          app.kubernetes.io/managed-by=datadog-operator
                          app.kubernetes.io/name=datadog-agent-deployment
                          app.kubernetes.io/part-of=system-datadog--agent
                          app.kubernetes.io/version=
                          operator.datadoghq.com/managed-by-store=true
Annotations:              <none>
Selector:                 agent.datadoghq.com/component=otel-agent-gateway,app.kubernetes.io/part-of=system-datadog--agent
Type:                     ClusterIP
IP Family Policy:         SingleStack
IP Families:              IPv4
IP:                       10.96.123.191
IPs:                      10.96.123.191
Port:                     otlpgrpcport  4317/TCP
TargetPort:               4317/TCP
AppProtocol:              kubernetes.io/h2c
Endpoints:                10.244.1.12:4317
Port:                     otlphttpport  4318/TCP
TargetPort:               4318/TCP
Endpoints:                10.244.1.12:4318
Session Affinity:         None
Internal Traffic Policy:  Cluster
Events:                   <none>

╰─❯ k describe svc datadog-agent-agent
Name:                     datadog-agent-agent
Namespace:                system
Labels:                   app.kubernetes.io/instance=datadog-agent
                          app.kubernetes.io/managed-by=datadog-operator
                          app.kubernetes.io/name=datadog-agent-deployment
                          app.kubernetes.io/part-of=system-datadog--agent
                          app.kubernetes.io/version=
                          operator.datadoghq.com/managed-by-store=true
Annotations:              <none>
Selector:                 agent.datadoghq.com/component=agent,app.kubernetes.io/part-of=system-datadog--agent
Type:                     ClusterIP
IP Family Policy:         SingleStack
IP Families:              IPv4
IP:                       10.96.193.19
IPs:                      10.96.193.19
Port:                     traceport  8126/TCP
TargetPort:               8126/TCP
Endpoints:                10.244.0.8:8126,10.244.1.11:8126
Port:                     dogstatsdport  8125/UDP
TargetPort:               8125/UDP
Endpoints:                10.244.0.8:8125,10.244.1.11:8125
Port:                     otlpgrpcport  4317/TCP
TargetPort:               4317/TCP
AppProtocol:              kubernetes.io/h2c
Endpoints:                10.244.0.8:4317,10.244.1.11:4317
Session Affinity:         None
Internal Traffic Policy:  Local
Events:                   <none>

Checklist

  • PR has at least one valid label: bug, enhancement, refactoring, documentation, tooling, and/or dependencies
  • PR has a milestone or the qa/skip-qa label
  • All commits are signed (see: signing commits)

@tbavelier tbavelier added this to the v1.29.0 milestone Jul 1, 2026
@tbavelier tbavelier added the enhancement New feature or request label Jul 1, 2026
@tbavelier tbavelier changed the title [codex] Add appProtocol to OTLP gRPC services [CONTP-1782] Add appProtocol to OTLP gRPC services Jul 1, 2026
@datadog-datadog-prod-us1

datadog-datadog-prod-us1 Bot commented Jul 1, 2026

Copy link
Copy Markdown

Pipelines  Code Coverage

Fix all issues with BitsAI

⚠️ Warnings

🚦 2 Pipeline jobs failed

pull request linter | Check Milestone   View in Datadog   GitHub Actions

pull request linter | build   View in Datadog   GitHub Actions

ℹ️ Info

🎯 Code Coverage (details)
Patch Coverage: 100.00%
Overall Coverage: 45.07% (+0.07%)

Useful? React with 👍 / 👎

This comment will be updated automatically if new data arrives.
🔗 Commit SHA: 03b07f5 | Docs | Datadog PR Page | Give us feedback!

@tbavelier
tbavelier marked this pull request as ready for review July 1, 2026 13:29
@tbavelier
tbavelier requested a review from a team July 1, 2026 13:29
@tbavelier
tbavelier requested a review from a team as a code owner July 1, 2026 13:29
@tbavelier
tbavelier requested review from mackjmr and removed request for a team July 1, 2026 13:29
@tbavelier
tbavelier merged commit cbf23ed into main Jul 1, 2026
43 of 45 checks passed
@tbavelier
tbavelier deleted the tbavelier/app-protocol-field branch July 1, 2026 15:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add appProtocol to otlp grpc service

3 participants