OTLP HTTP exporter reports a 3xx response as a successful export, so redirected batches are dropped without any log
Maintainer thường phản hồi trong vòng 2 ngày
@d4rshnn đang làm issue này rồi.
Từ ngày 31/10/2026.
Đánh giá
- Độ khó
- 2/5
- Thời gian dự kiến
- 1-3 giờ
- Mức phù hợp với người mới
- 72/100
- Loại issue
- Lỗi
- Độ rõ ràng
- Đặc tả rõ ràng
- Mức độ hoạt động
- Sôi nổi
- Công nghệ
- python
- Lĩnh vực
- observability
Hướng nghiên cứu
Bắt đầu với logic exporter dùng chung trong exporter/opentelemetry-exporter-otlp-common/src/opentelemetry/exporter/otlp/common/http.py, đặc biệt là các dòng được liên kết trong issue. Kiểm tra các bài kiểm thử hiện có về xử lý trạng thái HTTP export, sau đó xác minh rằng phản hồi 3xx tạo ra SpanExportResult.FAILURE và một log lỗi, trong khi các phản hồi thành công vẫn được xử lý là thành công.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
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
- Ngôn ngữ chính
- Python
- Star
- 2.7k
- Fork
- 1.1k
- Merge trung bình
- 4 ngày 13 phút
- Pull request đã merge (30 ngày)
- 38
Chuẩn bị môi trường
- Không có Dockerfile hay tệp Docker Compose
- Có mẫu pull request
- Đọc hướng dẫn đóng góp
Bắt đầu từ đâu
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Issue khác của open-telemetry/opentelemetry-python
-
opentelemetry-configuration: OTLP HTTP exporter does not validate TLS files exist at startupCó thể đã có người làm @Dotify71 đã nhận 5 ngày trước. Đang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100
open-telemetry/opentelemetry-python#5928 ·
Maintainer thường phản hồi trong vòng 2 ngày
-
W3CBaggagePropagator drops a list-member over 4096 bytes that W3C Baggage requires it to propagateCó thể đã có người làm @codedbyadiiii đã nhận 7 ngày trước. Đang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 70/100
open-telemetry/opentelemetry-python#5913 ·
Maintainer thường phản hồi trong vòng 2 ngày
-
otel.sdk.processor.{span,log}.queue.capacity uses synchronous UpDownCounter recorded once in __init__Có thể làm lại được Pull request cho issue này đã bị đóng mà không được merge. Đang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100
open-telemetry/opentelemetry-python#5891 ·
Maintainer thường phản hồi trong vòng 2 ngày
-
Prometheus map_unit incorrectly normalizes percent ratio units such as %/sCó thể đã có người làm @knowprasad đã nhận 10 ngày trước. Đang mởbug
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 84/100
open-telemetry/opentelemetry-python#5875 · 1 bình luận · 1 reaction ·
Maintainer thường phản hồi trong vòng 2 ngày
-
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 70/100
open-telemetry/opentelemetry-python#5700 · 1 bình luận ·
Maintainer thường phản hồi trong vòng 2 ngày
Tất cả issue của open-telemetry/opentelemetry-python
Issue tương tự
-
bug
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 66/100
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 75/100
docling-project/docling-pipelines#669 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
blocked kind/enhancement
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100
opendatahub-io/agent-eval-harness#329 · 2 bình luận · 1 reaction ·
-
cc_wrapper crashes with ValueError on Windows when a path is on another driveCó thể đã có người làm @TrapsterDK đã nhận hôm nay. Đang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 79/100
tweag/rules_haskell#2492 ·
Maintainer thường phản hồi trong vòng 1 ngày