Skip to content

[BUG] Python OTLP exporter ignores OTEL_EXPORTER_OTLP_PROTOCOL, always uses gRPC #1682

@shmuelarditi

Description

@shmuelarditi

Bug Description

The tracing setup in kagent-core (tracing/_utils.py) hardcodes gRPC OTLP exporters at import time:

from opentelemetry.exporter.otlp.proto.grpc.trace_exporter import OTLPSpanExporter
from opentelemetry.exporter.otlp.proto.grpc._log_exporter import OTLPLogExporter

The OTEL_EXPORTER_OTLP_TRACES_PROTOCOL / OTEL_EXPORTER_OTLP_PROTOCOL env vars are never read, so agents cannot use http/protobuf. This blocks integration with OTLP backends that only support HTTP (e.g., Langfuse).

Steps to Reproduce

  1. Set otel.tracing.exporter.otlp.protocol: http/protobuf in Helm values
  2. Confirm agent pods receive OTEL_EXPORTER_OTLP_TRACES_PROTOCOL=http/protobuf
  3. Agent still uses gRPC and fails:
grpc._channel._InactiveRpcError: UNKNOWN:Error received from peer {grpc_status:2, grpc_message:"Received http2 header with status: 464"}

Expected Behavior

The exporter should respect the protocol env var per the OpenTelemetry spec and select proto.http or proto.grpc accordingly.

Fix

PR #1681 addresses this with a minimal, backwards-compatible change.

Environment

  • kagent: v0.8.6 (also verified on main)
  • Backend: Langfuse Cloud (HTTP-only OTLP)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    Status

    Backlog

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions