posthog-rails logs: /i/v1/logs returns JSON {} to protobuf OTLP requests, causing ExportLogsServiceResponse decode ERROR on every export
I maintainer di solito rispondono entro 1 giorno
Nessuno ha ancora preso questa issue.
Valutazione
- Difficoltà
- 4/5
- Tempo stimato
- 3-5 giorni
- Idoneità per principianti
- 45/100
Direzione di ricerca
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.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
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.
- Lingua principale
- Ruby
- Stelle
- 37
- Fork
- 34
- Merge medio
- 20h 30m
- PR unite (30g)
- 24
Preparare l'ambiente
- Nessun Dockerfile né file Docker Compose
- Ha un modello di pull request
- Leggi la guida per i contributori
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Altre issue di PostHog/posthog-ruby
-
bug enhancement feature/feature-flags
Difficoltà 3/5 1-2 giorni Idoneità per principianti 68/100
PostHog/posthog-ruby#189 ·
I maintainer di solito rispondono entro 1 giorno
-
enhancement feature/feature-flags
Difficoltà 4/5 3-5 giorni Idoneità per principianti 48/100
PostHog/posthog-ruby#188 ·
I maintainer di solito rispondono entro 1 giorno
-
bug enhancement
Difficoltà 3/5 1-2 giorni Idoneità per principianti 68/100
PostHog/posthog-ruby#186 ·
I maintainer di solito rispondono entro 1 giorno
-
enhancement team/logs
Difficoltà 5/5 Più di una settimana Idoneità per principianti 35/100
PostHog/posthog-ruby#185 ·
I maintainer di solito rispondono entro 1 giorno
-
SDK referencesApertadocumentation
Difficoltà 4/5 3-5 giorni Idoneità per principianti 35/100
PostHog/posthog-ruby#148 ·
I maintainer di solito rispondono entro 1 giorno
Tutte le issue di PostHog/posthog-ruby
Issue simili
-
agent:triaged bug bughunt pm:bundler priority:p1
Difficoltà 2/5 1-3 ore Idoneità per principianti 70/100
SocketDev/socket-patch#1573 · 1 commento ·
I maintainer di solito rispondono entro 1 giorno
-
Generated server webpack config keeps Rspack's manifest and CSS extraction pluginsForse già presa @justin808 l’ha presa oggi. Apertabug
Difficoltà 2/5 1-3 ore Idoneità per principianti 72/100
shakacode/react_on_rails#5184 ·
I maintainer di solito rispondono entro 1 giorno
-
bug chat verified
Difficoltà 2/5 1-3 ore Idoneità per principianti 72/100
I maintainer di solito rispondono entro 6 giorni
-
🐞 bug pending triage
Difficoltà 2/5 1-3 ore Idoneità per principianti 72/100
CircuitVerse/CircuitVerse#8031 · 2 commenti ·
I maintainer di solito rispondono entro 1 giorno
-
Empty members in the Accept header cause a 500Forse già presa @koic l’ha presa oggi. Apertabug
Difficoltà 2/5 1-3 ore Idoneità per principianti 82/100
modelcontextprotocol/ruby-sdk#609 ·
I maintainer di solito rispondono entro 1 giorno