Constructs OTLP export envelopes using generated protobuf encoders.
Summary
Functions
Encodes log records or metric messages under a single resource and scope.
Functions
@spec encode(:logs | :metrics, [map()], map()) :: {:ok, binary()} | {:error, :invalid_payload | :invalid_signal}
Encodes log records or metric messages under a single resource and scope.
Inputs are OTLP message maps, not raw Logger events or metric definitions. Malformed protobuf values return a tagged error without exposing the payload.
iex> {:ok, resource} = OtlpShipper.Resource.new(service_name: "checkout")
iex> record = %{body: OtlpShipper.Value.encode("ready")}
iex> {:ok, bytes} = OtlpShipper.Encoder.encode(:logs, [record], resource)
iex> is_binary(bytes)
true