posthog-rails logs: /i/v1/logs returns JSON {} to protobuf OTLP requests, causing ExportLogsServiceResponse decode ERROR on every export
Maintainer thường phản hồi trong vòng 1 ngày
Chưa có ai nhận issue này.
Đánh giá
- Độ khó
- 4/5
- Thời gian dự kiến
- 3-5 ngày
- Mức phù hợp với người mới
- 45/100
Hướng nghiên cứu
The report identifies the /i/v1/logs ingestion endpoint and the OTLP logs exporter as the relevant entry points, but does not name repository files or tests. Start by tracing how the endpoint handles application/x-protobuf requests and compare its response with the OTLP/HTTP expectation described here. Done means protobuf requests receive a valid protobuf response (or an empty body) with the appropriate content type, without triggering the exporter decode error.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
Summary
With config.logs_enabled = true, posthog-rails sets up OpenTelemetry::Exporter::OTLP::Logs::LogsExporter pointed at https://us.i.posthog.com/i/v1/logs. The exporter sends Content-Type: application/x-protobuf, but the endpoint replies 200 with content-type: application/json and a body of {}. The exporter then tries to decode that body as a protobuf ExportLogsServiceResponse and fails, which logs an ERROR on every batch export.
Environment
- Ruby 3.3
- posthog-ruby 3.23.x
- posthog-rails 3.18.6
- opentelemetry-exporter-otlp-logs 0.6.0 (latest)
- opentelemetry-logs-sdk 0.8.0
Repro
curl -s -D - -X POST https://us.i.posthog.com/i/v1/logs \
-H 'Content-Type: application/x-protobuf' \
-H 'Authorization: Bearer phc_test' \
--data-binary @/dev/null
Response:
HTTP/2 200
content-type: application/json
content-length: 2
{}
On a 2xx response the exporter calls log_partial_success(response.body), which runs ExportLogsServiceResponse.decode("{}") and raises Google::Protobuf::ParseError. Every export then logs:
ERROR -- : OpenTelemetry error: unexpected error decoding ExportLogsServiceResponse in OTLP::Exporter#log_partial_success - Error occurred during parsing - .../opentelemetry-exporter-otlp-logs-0.6.0/lib/opentelemetry/exporter/otlp/logs/logs_exporter.rb:246:in 'decode'
Expected vs actual
- Expected: Per the OTLP/HTTP spec, the response uses the request's Content-Type, so a protobuf request gets back a protobuf-encoded
ExportLogsServiceResponse. An empty body is a valid empty message. No error is logged. - Actual: The JSON
{}body causes an ERROR-level log line on every batch export from every process. Records are still ingested, because the exporter has already returned SUCCESS. But the noise is constant and hides real export failures.
Suggested fix
- Ingestion endpoint: for
application/x-protobufrequests, return an empty body or a protobuf-encodedExportLogsServiceResponsewithcontent-type: application/x-protobuf. - Until then, posthog-rails could install a scoped
OpenTelemetry.error_handlerfilter for this specific decode error, or document the noise.
- Ngôn ngữ chính
- Ruby
- Star
- 37
- Fork
- 34
- Merge trung bình
- 20 giờ 30 phút
- Pull request đã merge (30 ngày)
- 24
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 PostHog/posthog-ruby
-
bug enhancement feature/feature-flags
Độ khó 3/5 1-2 ngày Mức phù hợp với người mới 68/100
PostHog/posthog-ruby#189 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
enhancement feature/feature-flags
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 48/100
PostHog/posthog-ruby#188 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
bug enhancement
Độ khó 3/5 1-2 ngày Mức phù hợp với người mới 68/100
PostHog/posthog-ruby#186 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
enhancement team/logs
Độ khó 5/5 Hơn một tuần Mức phù hợp với người mới 35/100
PostHog/posthog-ruby#185 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
SDK referencesĐang mởdocumentation
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 35/100
PostHog/posthog-ruby#148 ·
Maintainer thường phản hồi trong vòng 1 ngày
Tất cả issue của PostHog/posthog-ruby
Issue tương tự
-
NoMethodError in auth#createĐang mởbugsnag
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 62/100
JoeMcB/improvcoaches#827 ·
-
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 72/100
TheOdinProject/curriculum#31465 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
area: docs eco: ruby good first issue help wanted lane: free-agent roadmap size: XS type: docs
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 66/100
arminazimi/evergreen#465 ·
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
-
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 72/100
simp/puppetsync#120 ·
Maintainer thường phản hồi trong vòng 2 ngày