OTLP API
Generated public TypeScript reference for @relkit/otlp.
For configuration and examples, read observability.
Public imports
@relkit/otlp— 3 exports@relkit/otlp/runtime— 9 exports
All exported APIs
Names link to their complete contracts. Re-exports share their original contract; legacy exports keep their separate identity. Examples link to the API’s inline sample, a maintained repository usage, or the shared module walkthrough.
| API | Kind | Import from | Example |
|---|---|---|---|
| createOtlpExporter | Value | @relkit/otlp/runtime |
Module example |
| createOtlpTransport | Value | @relkit/otlp/runtime |
Module example |
| createTelemetryExporter | Value | @relkit/otlp/runtime |
Module example |
| otlp | Value | @relkit/otlp |
Source example |
| OtlpExporter | Type | @relkit/otlp/runtime |
Module example |
| OtlpExporterOptions | Type | @relkit/otlp/runtime |
Module example |
| OtlpOptions | Type | @relkit/otlp |
Module example |
| OtlpSignal | Type | @relkit/otlp/runtime |
Module example |
| OtlpTelemetryExporter | Type | @relkit/otlp |
Module example |
| OtlpTransport | Type | @relkit/otlp/runtime |
Module example |
| OtlpTransportOptions | Type | @relkit/otlp/runtime |
Module example |
| runtimeIntegration | Value | @relkit/otlp/runtime |
Module example |
index.ts
“./otlp.js” (namespace export)
Re-exports all named exports from the “./otlp.js” module.
Signature
export * from "./otlp.js";
otlp.ts
OtlpOptions (interface)
Signature
export interface OtlpOptions {
readonly endpoint: TextInput;
readonly headers?: Readonly<Record<string, TextInput>>;
readonly serviceName?: TextInput;
}
OtlpTelemetryExporter (type alias)
Signature
type OtlpTelemetryExporter = TelemetryExporterDescriptor<"otlp", "otlp", OtlpOptions>;
otlp
Declares one statically loaded OTLP/HTTP telemetry exporter.
Signature
declare const otlp: (options: OtlpOptions) => OtlpTelemetryExporter;
exporter-support.ts
combinedSignal
Signature
declare const combinedSignal: (first: AbortSignal, second: AbortSignal | undefined) => AbortSignal;
nonNegative
Signature
declare const nonNegative: (value: number, name: string) => number;
otlpPayload
Signature
declare const otlpPayload: (
serviceName: string | undefined,
records: readonly RedactedObservabilityRecord[],
signal: OtlpSignal,
) => JsonValue;
otlpSignalFor
Signature
declare const otlpSignalFor: (record: RedactedObservabilityRecord) => OtlpSignal | undefined;
otlpUnitId
Signature
declare const otlpUnitId: (record: RedactedObservabilityRecord, sequence: number) => string;
positive
Signature
declare const positive: (value: number, name: string) => number;
text
Signature
declare const text: (value: unknown, name: string) => string;
textMap
Signature
declare const textMap: (value: unknown) => Readonly<Record<string, string>>;
within
Signature
declare const within: (operation: Promise<unknown>, timeoutMs: number) => Promise<boolean>;
exporter.ts
OtlpExporter (interface)
Signature
export interface OtlpExporter extends TelemetryExporterRuntime {
readonly stats: () => TelemetryExporterRuntimeStats & {
readonly exportedRecords: number;
readonly retries: number;
};
}
OtlpExporterOptions (interface)
Signature
export interface OtlpExporterOptions {
readonly transport: OtlpTransport;
readonly serviceName?: string;
readonly maxRecords?: number;
readonly batchSize?: number;
readonly maxRetries?: number;
readonly retryDelayMs?: number;
readonly signal?: AbortSignal;
readonly delay?: (milliseconds: number) => Promise<void>;
}
createOtlpExporter
Signature
declare const createOtlpExporter: (options: OtlpExporterOptions) => OtlpExporter;
createTelemetryExporter
Signature
declare const createTelemetryExporter: (
context: TelemetryExporterFactoryContext,
) => Promise<TelemetryExporterRuntime>;
index.ts
“./exporter.js” (namespace export)
Re-exports all named exports from the “./exporter.js” module.
Signature
export * from "./exporter.js";
“./transport.js” (namespace export)
Re-exports all named exports from the “./transport.js” module.
Signature
export * from "./transport.js";
runtimeIntegration
Signature
declare const runtimeIntegration: Readonly<{
kind: "runtime-integration";
integrationId: "otlp";
registrations: ReadonlyArray<{ capability: string; adapterId: string; protocolVersion: number }>;
}>;
transport.ts
OtlpSignal (type alias)
Signature
type OtlpSignal = "logs" | "traces";
OtlpTransport (interface)
Signature
export interface OtlpTransport {
readonly send: (signal: OtlpSignal, payload: JsonValue, abort?: AbortSignal) => Promise<void>;
readonly flush: () => Promise<void>;
readonly close: () => Promise<void>;
}
OtlpTransportOptions (interface)
Signature
export interface OtlpTransportOptions {
readonly endpoint: string;
readonly headers?: Readonly<Record<string, string>>;
readonly fetch?: typeof globalThis.fetch;
}
createOtlpTransport
Signature
declare const createOtlpTransport: (options: OtlpTransportOptions) => OtlpTransport;