OtlpHttpEdge

constructor(client: HttpClient, endpoint: String, store: DurableStore, maxSentIds: Int = DEFAULT_MAX_SENT_IDS, wire: OtlpWireFormat = OtlpWireFormat.JSON, @IntroducedAt(version = "0.7.5") resource: Map<String, String> = emptyMap(), @IntroducedAt(version = "0.7.5") scopeName: String = "", @IntroducedAt(version = "0.7.5") scopeVersion: String = "", @IntroducedAt(version = "0.7.6") maxRequestBytes: Int = DEFAULT_MAX_REQUEST_BYTES)

Parameters

client

caller-owned Ktor HttpClient — it owns the engine, timeouts, TLS, and any auth headers. kuilt does not create or close it, and this module ships no engine: depend on one (ktor-client-okhttp, ktor-client-java, ktor-client-darwin, …) and pass it, as in HttpClient(OkHttp).

endpoint

collector base URL, e.g. https://collector:4318. Any trailing / is trimmed, so .../:4318/ and .../:4318 are one collector. The sent-set StoreKey identifies the endpoint by a 128-bit SHA-256 tag rather than by the URL, so two collectors never share a sent-set, the key is a fixed width whatever the URL's length, and a URL carrying credentials never reaches a filename. Length is unconstrained here.

store

durable persistence for the per-endpoint sent-set. Give each producer its own store, or its own endpoint: every drain prunes the metric record to the draining producer's live series, so two producers sharing one store and endpoint would each prune the other's, then resend their whole metric set on every drain.

maxSentIds

cap on the span/log sent-set size (drop-oldest). The metric sent-versions map takes no cap: every drain prunes it to the series the producer still holds (retainMetrics), so it is bounded by the producer's maxMetrics.

wire

OTLP wire encoding to emit. Defaults to OtlpWireFormat.JSON.

resource

this producer's resource attributes, sent as the resource of every request on both wires — service.name and whatever else tells one producer from another, so a collector or backend files its records under their own service rather than one unknown one. Fixed for the edge's life, as a producer's resource is. Empty, the default, sends no resource at all.

scopeName

the instrumentation scope's name, sent as the scope of every request on both wires: the library that recorded the telemetry.

scopeVersion

the instrumentation scope's version. When both scopeName and scopeVersion are empty, the default, no scope is sent; OTLP reads an empty name as an unknown scope either way.

maxRequestBytes

the largest body, in bytes before any compression the client applies, that one request may carry; a batch over it is split. Defaults to DEFAULT_MAX_REQUEST_BYTES, 1 MiB, the limit a reverse proxy commonly enforces in front of a collector, which itself defaults to 20 MiB. It must hold one minimal record inside this edge's resource and scope, or construction throws IllegalArgumentException: an envelope that fills the cap would otherwise send every record alone.