Skip to content
RELKIT
Esc
↑↓navigate↵open⌘Jpreview
On this page

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";

Source

otlp.ts

OtlpOptions (interface)

Signature

export interface OtlpOptions {
  readonly endpoint: TextInput;
  readonly headers?: Readonly<Record<string, TextInput>>;
  readonly serviceName?: TextInput;
}

Source

OtlpTelemetryExporter (type alias)

Signature

type OtlpTelemetryExporter = TelemetryExporterDescriptor<"otlp", "otlp", OtlpOptions>;

Source

otlp

Declares one statically loaded OTLP/HTTP telemetry exporter.

Signature

declare const otlp: (options: OtlpOptions) => OtlpTelemetryExporter;

Source

exporter-support.ts

combinedSignal

Signature

declare const combinedSignal: (first: AbortSignal, second: AbortSignal | undefined) => AbortSignal;

Source

nonNegative

Signature

declare const nonNegative: (value: number, name: string) => number;

Source

otlpPayload

Signature

declare const otlpPayload: (
  serviceName: string | undefined,
  records: readonly RedactedObservabilityRecord[],
  signal: OtlpSignal,
) => JsonValue;

Source

otlpSignalFor

Signature

declare const otlpSignalFor: (record: RedactedObservabilityRecord) => OtlpSignal | undefined;

Source

otlpUnitId

Signature

declare const otlpUnitId: (record: RedactedObservabilityRecord, sequence: number) => string;

Source

positive

Signature

declare const positive: (value: number, name: string) => number;

Source

text

Signature

declare const text: (value: unknown, name: string) => string;

Source

textMap

Signature

declare const textMap: (value: unknown) => Readonly<Record<string, string>>;

Source

within

Signature

declare const within: (operation: Promise<unknown>, timeoutMs: number) => Promise<boolean>;

Source

exporter.ts

OtlpExporter (interface)

Signature

export interface OtlpExporter extends TelemetryExporterRuntime {
  readonly stats: () => TelemetryExporterRuntimeStats & {
    readonly exportedRecords: number;
    readonly retries: number;
  };
}

Source

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>;
}

Source

createOtlpExporter

Signature

declare const createOtlpExporter: (options: OtlpExporterOptions) => OtlpExporter;

Source

createTelemetryExporter

Signature

declare const createTelemetryExporter: (
  context: TelemetryExporterFactoryContext,
) => Promise<TelemetryExporterRuntime>;

Source

index.ts

“./exporter.js” (namespace export)

Re-exports all named exports from the “./exporter.js” module.

Signature

export * from "./exporter.js";

Source

“./transport.js” (namespace export)

Re-exports all named exports from the “./transport.js” module.

Signature

export * from "./transport.js";

Source

runtimeIntegration

Signature

declare const runtimeIntegration: Readonly<{
  kind: "runtime-integration";
  integrationId: "otlp";
  registrations: ReadonlyArray<{ capability: string; adapterId: string; protocolVersion: number }>;
}>;

Source

transport.ts

OtlpSignal (type alias)

Signature

type OtlpSignal = "logs" | "traces";

Source

OtlpTransport (interface)

Signature

export interface OtlpTransport {
  readonly send: (signal: OtlpSignal, payload: JsonValue, abort?: AbortSignal) => Promise<void>;
  readonly flush: () => Promise<void>;
  readonly close: () => Promise<void>;
}

Source

OtlpTransportOptions (interface)

Signature

export interface OtlpTransportOptions {
  readonly endpoint: string;
  readonly headers?: Readonly<Record<string, string>>;
  readonly fetch?: typeof globalThis.fetch;
}

Source

createOtlpTransport

Signature

declare const createOtlpTransport: (options: OtlpTransportOptions) => OtlpTransport;

Source