OTLP HTTP exporter reports a 3xx response as a successful export, so redirected batches are dropped without any log
维护者通常 2 天内回复
@d4rshnn 已经在做这个了。
开始于 2026年10月31日。
评估
- 难度
- 2/5
- 预计耗时
- 1-3 小时
- 新手友好度
- 72/100
- Issue 类型
- 缺陷
- 描述清晰度
- 描述清楚
- 活跃度
- 活跃
- 技术栈
- python
调研方向
从 exporter/opentelemetry-exporter-otlp-common/src/opentelemetry/exporter/otlp/common/http.py 中的共享 exporter 逻辑入手,尤其关注 issue 中链接的代码行。检查现有的 HTTP 导出状态处理测试,然后验证 3xx 响应会产生 SpanExportResult.FAILURE 和错误日志,而成功响应仍会被视为成功。
由索引模型根据 Issue 内容生成。
描述
Describe your environment
OS: macOS (Darwin 25.5.0)
Python version: 3.14.6
SDK version: 1.45.1 (opentelemetry-exporter-otlp-proto-http 1.45.1, opentelemetry-exporter-otlp-common 0.66b1, opentelemetry-exporter-http-transport 0.66b1)
API version: 1.45.1
What happened?
Redirections are not followed and are not logged as error. It makes the batches silently dropped.
Both HTTP transports turn off redirects since #5194.
The shared exporter code still counts any status from 200 to 399 as success. So a 308 comes back as SpanExportResult.SUCCESS, nothing is logged and the batch is lost.
Steps to Reproduce
The following code runs a server that always redirects and tries to export to that server. The export is successful.
import logging
import threading
from http.server import BaseHTTPRequestHandler, HTTPServer
from opentelemetry.exporter.otlp.proto.http.trace_exporter import OTLPSpanExporter
from opentelemetry.sdk.trace import TracerProvider
logging.basicConfig(level=logging.DEBUG)
class AlwaysRedirect(BaseHTTPRequestHandler):
def do_POST(self):
self.rfile.read(int(self.headers["Content-Length"]))
self.send_response(308)
self.send_header("Location", "/elsewhere/v1/traces")
self.send_header("Content-Length", "0")
self.end_headers()
server = HTTPServer(("127.0.0.1", 0), AlwaysRedirect)
threading.Thread(target=server.serve_forever, daemon=True).start()
span = TracerProvider().get_tracer("repro").start_span("span")
span.end()
exporter = OTLPSpanExporter(endpoint=f"http://127.0.0.1:{server.server_port}/v1/traces")
print("export result:", exporter.export([span]))
Expected Result
The export is reported as failed (SpanExportResult.FAILURE) with an error log.
Actual Result
The export is successful but nothing is really exported and batches are lost.
Additional context
No response
Would you like to implement a fix?
No response
Tip
No response
- 主要语言
- Python
- 星标
- 2.7k
- 派生
- 1.1k
- 平均合并
- 4 天 13 分钟
- 30 天内合并 PR
- 38
环境准备
- 没有 Dockerfile 或 Docker Compose 文件
- 有 Pull Request 模板
- 阅读贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
open-telemetry/opentelemetry-python 的其他 Issue
-
opentelemetry-configuration: OTLP HTTP exporter does not validate TLS files exist at startup可能已有人在做 @Dotify71 于 5 天前认领。 未关闭
难度 2/5 1-3 小时 新手友好度 78/100
open-telemetry/opentelemetry-python#5928 ·
维护者通常 2 天内回复
-
W3CBaggagePropagator drops a list-member over 4096 bytes that W3C Baggage requires it to propagate可能已有人在做 @codedbyadiiii 于 7 天前认领。 未关闭
难度 2/5 1-3 小时 新手友好度 70/100
open-telemetry/opentelemetry-python#5913 ·
维护者通常 2 天内回复
-
otel.sdk.processor.{span,log}.queue.capacity uses synchronous UpDownCounter recorded once in __init__可能重新可做 关联的 PR 已关闭且未合并。 未关闭
难度 2/5 1-3 小时 新手友好度 78/100
open-telemetry/opentelemetry-python#5891 ·
维护者通常 2 天内回复
-
Prometheus map_unit incorrectly normalizes percent ratio units such as %/s可能已有人在做 @knowprasad 于 10 天前认领。 未关闭bug
难度 2/5 1-3 小时 新手友好度 84/100
open-telemetry/opentelemetry-python#5875 · 1 条评论 · 1 个 reaction ·
维护者通常 2 天内回复
-
难度 1/5 1 小时以内 新手友好度 70/100
open-telemetry/opentelemetry-python#5700 · 1 条评论 ·
维护者通常 2 天内回复
查看 open-telemetry/opentelemetry-python 的全部 Issue
相似的 Issue
-
bug
难度 2/5 1-3 小时 新手友好度 78/100
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 66/100
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 75/100
docling-project/docling-pipelines#669 ·
维护者通常 1 天内回复
-
blocked kind/enhancement
难度 2/5 1-3 小时 新手友好度 78/100
opendatahub-io/agent-eval-harness#329 · 2 条评论 · 1 个 reaction ·
-
cc_wrapper crashes with ValueError on Windows when a path is on another drive可能已有人在做 @TrapsterDK 今天认领。 未关闭
难度 2/5 1-3 小时 新手友好度 79/100
tweag/rules_haskell#2492 ·
维护者通常 1 天内回复