feat(telemetry): respect OTEL_EXPORTER_OTLP_PROTOCOL — support HTTP/protobuf exporter

未关闭 适合新手
#1,210 0 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看

维护者通常 3 天内回复

还没有人认领这个 Issue。

评估

难度
2/5
预计耗时
1-3 小时
新手友好度
66/100
Issue 类型
功能
描述清晰度
描述清楚
活跃度
冷清
技术栈
python
领域
observability

调研方向

gRPC 导出器从 opentelemetry.exporter.otlp.proto.grpc 被无条件导入(OTLPSpanExporter 和 OTLPMetricExporter),因此请先找到 mellea 的遥测配置在哪里导入它们。检查它如何读取端点和环境变量,然后为 OTEL_EXPORTER_OTLP_PROTOCOL=http/protobuf 添加一个分支,使用来自 opentelemetry.exporter.otlp.proto.http 的导出器。当该设置能选中 HTTP 导出器、默认值和 grpc 的行为与之前一致,并且通过测试或手动运行确认了 HTTP 路径时,即为完成。

由索引模型根据 Issue 内容生成。

描述

area/telemetry enhancement p2

Mellea unconditionally imports `OTLPSpanExporter` and `OTLPMetricExporter` from `opentelemetry.exporter.otlp.proto.grpc`, hardcoding the gRPC transport for all signals. The standard `OTEL_EXPORTER_OTLP_PROTOCOL` environment variable is ignored.

The OTel SDK specification requires that `OTEL_EXPORTER_OTLP_PROTOCOL` be honoured. Most production collector stacks support both gRPC (port 4317) and HTTP/protobuf (port 4318), so this is not a critical gap for most deployments. However:

  • Users who prefer or require HTTP/protobuf (e.g. environments where gRPC is blocked, or sidecar collectors configured for HTTP only) cannot switch without patching mellea.
  • The hardcoded gRPC path means the transport cannot be overridden via the standard env var, diverging from the behaviour users expect from any other OTel-instrumented service.

Expected behaviour

When `OTEL_EXPORTER_OTLP_PROTOCOL=http/protobuf` is set, mellea should use `opentelemetry.exporter.otlp.proto.http` exporters targeting port 4318. When unset or `grpc`, current behaviour is correct.

HTTP/protobuf on port 4318 is confirmed to work with standard OTLP receivers; the exporter package is already a transitive dependency of the OTel Python SDK.

主要语言
Python
星标
1.8k
派生
161
平均合并
4 天 3 小时
30 天内合并 PR
45

环境准备

从这里开始

  1. 先读完整个 Issue,再读项目的贡献指南。
  2. 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
  3. Fork 仓库,在一个分支上完成修改。
  4. 提交 Pull Request,并在描述里引用这个 Issue 编号。

generative-computing/mellea 的其他 Issue

查看 generative-computing/mellea 的全部 Issue

相似的 Issue

更多 Python Issue

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。