Skip to content

Add OTLP protobuf ingest support#8

Open
sms-swe wants to merge 1 commit into
kitlangton:mainfrom
sms-swe:add-otlp-protobuf-ingest
Open

Add OTLP protobuf ingest support#8
sms-swe wants to merge 1 commit into
kitlangton:mainfrom
sms-swe:add-otlp-protobuf-ingest

Conversation

@sms-swe

@sms-swe sms-swe commented Apr 24, 2026

Copy link
Copy Markdown

Summary

Adds support for binary OTLP protobuf ingest on the existing OTLP/HTTP trace and log endpoints.

Why

Motel currently accepts OTLP protobuf-JSON payloads, but many OpenTelemetry SDKs send binary protobuf by default. In particular, Go’s standard OTLP/HTTP exporters, such as go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracehttp, default to Content-Type: application/x-protobuf.
Without protobuf support, a default Go OpenTelemetry setup cannot send traces/logs to Motel without additional exporter configuration.

Changes

  • Decode application/x-protobuf and application/protobuf requests for:
    • POST /v1/traces
    • POST /v1/logs
  • Preserve existing application/json protobuf-JSON ingest behavior.
  • Normalize decoded protobuf IDs and byte values into the protobuf-JSON shape expected by the existing telemetry store.
  • Add focused unit coverage for protobuf trace and log decoding.
  • Update README, copied setup instructions, OpenAPI descriptions, and motel-debug docs to mention protobuf support.

Scope note

The runtime change is intentionally small: the ingest handlers now choose JSON vs protobuf decoding based on Content-Type, then pass the resulting protobuf-JSON-shaped payload into the existing ingest path.
The remaining file changes are supporting updates:

  • Tests cover protobuf decoding for traces and logs.
  • Docs/setup text/OpenAPI descriptions were updated so users know both OTLP/HTTP encodings are supported.
  • package.json/bun.lock add the direct OTLP transformer dependency used for decoding the generated OTLP protobuf messages.

Verification

  • bun run typecheck
  • bun run test

@michielryvers

Copy link
Copy Markdown

Can't comment on the code, but I'm running this branch locally and works well for me. Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants