UNPKG

@grafana/faro-transport-otlp-http

Version:

Faro transport which converts the Faro data model to the Otlp data model.

25 lines (24 loc) 971 B
import type { ExceptionEvent, MeasurementEvent, TransportItem } from '@grafana/faro-core'; export interface OtlpTransportRequestOptions extends Omit<RequestInit, 'body' | 'headers'> { /** * Headers to include in every request. * Each value can be: * - a string (static value) * - a function returning a string (dynamic value) * - a function returning a Promise of string (dynamic value, async) */ headers?: Record<string, string | (() => string | Promise<string>)>; } export interface OtlpHttpTransportOptions { apiKey?: string; bufferSize?: number; concurrency?: number; defaultRateLimitBackoffMs?: number; requestOptions?: OtlpTransportRequestOptions; readonly tracesURL?: string; readonly logsURL?: string; otlpTransform?: { createErrorLogBody?: (item: TransportItem<ExceptionEvent>) => string; createMeasurementLogBody?: (item: TransportItem<MeasurementEvent>) => string; }; }