Class: HttpTransport
Prefactor TypeScript SDK / @prefactor/core / HttpTransport
Class: HttpTransport
Section titled “Class: HttpTransport”Defined in: packages/core/src/transport/http.ts:128
HTTP-backed transport that serializes span operations through an internal queue.
Implements
Section titled “Implements”Constructors
Section titled “Constructors”Constructor
Section titled “Constructor”new HttpTransport(
config,options?):HttpTransport
Defined in: packages/core/src/transport/http.ts:160
Parameters
Section titled “Parameters”config
Section titled “config”apiUrl
Section titled “apiUrl”string = ...
API endpoint URL
apiToken
Section titled “apiToken”string = ...
Authentication token
agentIdentifier
Section titled “agentIdentifier”string = ...
Agent identifier (external identifier); defaults to v1.0.0 when omitted
requestTimeout
Section titled “requestTimeout”number = ...
Request timeout in milliseconds
maxRetries
Section titled “maxRetries”number = ...
Maximum number of retry attempts
initialRetryDelay
Section titled “initialRetryDelay”number = ...
Initial delay between retries in milliseconds
maxRetryDelay
Section titled “maxRetryDelay”number = ...
Maximum delay between retries in milliseconds
retryMultiplier
Section titled “retryMultiplier”number = ...
Multiplier for exponential backoff
retryOnStatusCodes
Section titled “retryOnStatusCodes”number[] = ...
Status codes that should trigger retries
agentId?
Section titled “agentId?”string = ...
Optional agent instance identifier (internal ID)
agentName?
Section titled “agentName?”string = ...
Optional agent name
agentDescription?
Section titled “agentDescription?”string = ...
Optional agent description
agentSchema?
Section titled “agentSchema?”Record<string, unknown> = ...
Optional agent schema for validation (full schema object)
options?
Section titled “options?”HttpTransportOptions
Returns
Section titled “Returns”HttpTransport
Methods
Section titled “Methods”registerControlSignalCallback()
Section titled “registerControlSignalCallback()”registerControlSignalCallback(
fn):void
Defined in: packages/core/src/transport/http.ts:188
Registers a callback that fires when any span response contains a termination control signal. Called by createCore to wire the monitor.
Parameters
Section titled “Parameters”(reason) => void
Returns
Section titled “Returns”void
registerSchema()
Section titled “registerSchema()”registerSchema(
schema):void
Defined in: packages/core/src/transport/http.ts:192
Parameters
Section titled “Parameters”schema
Section titled “schema”Record<string, unknown>
Returns
Section titled “Returns”void
Implementation of
Section titled “Implementation of”startAgentInstance()
Section titled “startAgentInstance()”startAgentInstance(
options?):void
Defined in: packages/core/src/transport/http.ts:212
Parameters
Section titled “Parameters”options?
Section titled “options?”Returns
Section titled “Returns”void
Implementation of
Section titled “Implementation of”finishAgentInstance()
Section titled “finishAgentInstance()”finishAgentInstance():
void
Defined in: packages/core/src/transport/http.ts:225
Returns
Section titled “Returns”void
Implementation of
Section titled “Implementation of”recordQuality()
Section titled “recordQuality()”recordQuality(
payload):void
Defined in: packages/core/src/transport/http.ts:246
Enqueues a record-quality action for the current agent instance.
A null payload removes the recorded value for that name. The action is queued and retried like other transport actions.
Parameters
Section titled “Parameters”payload
Section titled “payload”Quality schema name and payload (or null to remove).
string
payload
Section titled “payload”Record<string, unknown> | null
Returns
Section titled “Returns”void
Implementation of
Section titled “Implementation of”emit()
Section titled “emit()”emit(
span):void
Defined in: packages/core/src/transport/http.ts:261
Parameters
Section titled “Parameters”Returns
Section titled “Returns”void
Implementation of
Section titled “Implementation of”finishSpan()
Section titled “finishSpan()”finishSpan(
spanId,endTime,options?):void
Defined in: packages/core/src/transport/http.ts:271
Parameters
Section titled “Parameters”spanId
Section titled “spanId”string
endTime
Section titled “endTime”number
options?
Section titled “options?”FinishSpanOptions
Returns
Section titled “Returns”void
Implementation of
Section titled “Implementation of”assertUsable()
Section titled “assertUsable()”assertUsable(
operation):void
Defined in: packages/core/src/transport/http.ts:285
Parameters
Section titled “Parameters”operation
Section titled “operation”Returns
Section titled “Returns”void
Implementation of
Section titled “Implementation of”getHealthState()
Section titled “getHealthState()”getHealthState():
PrefactorTransportHealthState
Defined in: packages/core/src/transport/http.ts:296
Returns
Section titled “Returns”Implementation of
Section titled “Implementation of”getAgentInstanceId()
Section titled “getAgentInstanceId()”getAgentInstanceId():
string|null
Defined in: packages/core/src/transport/http.ts:300
Returns
Section titled “Returns”string | null
Implementation of
Section titled “Implementation of”getHttpRequester()
Section titled “getHttpRequester()”getHttpRequester():
HttpRequester
Defined in: packages/core/src/transport/http.ts:304
Returns
Section titled “Returns”Implementation of
Section titled “Implementation of”validateToken()
Section titled “validateToken()”validateToken():
Promise<void>
Defined in: packages/core/src/transport/http.ts:308
Returns
Section titled “Returns”Promise<void>
Implementation of
Section titled “Implementation of”close()
Section titled “close()”close():
Promise<void>
Defined in: packages/core/src/transport/http.ts:326
Returns
Section titled “Returns”Promise<void>