adk_otlp_http_transport behaviour (erlang_adk v0.7.0)

View Source

Injectable transport boundary for the OTLP/HTTP JSON exporter.

The production implementation is adk_openapi_gun_transport, whose request contract already enforces exact host/scheme allowlists, bounded response streaming, verified HTTPS, deadlines, and no redirect following.

Summary

Types

handle/0

-type handle() :: term().

request/0

-type request() ::
          #{method := binary(),
            url := binary(),
            headers := [{binary(), binary()}],
            body := binary(),
            timeout_ms := pos_integer(),
            max_response_bytes := pos_integer(),
            follow_redirects := false,
            allowed_schemes := [binary()],
            allowed_hosts := [binary()],
            allow_private_hosts := boolean()}.

response/0

-type response() :: #{status := pos_integer(), headers := [{binary(), binary()}], body := binary()}.

Callbacks

request/2

-callback request(Handle :: handle(), Request :: request()) -> {ok, response()} | {error, term()}.