Otlp unstable
Configures OpenTelemetry Protocol (OTLP) HTTP export for Effect telemetry.
This module installs the OTLP logger, metrics exporter, and tracer exporter from one shared configuration. Use it when an application sends logs, metrics, and traces to the same OpenTelemetry Collector, vendor OTLP endpoint, or local development collector.
Layers
Creates a combined OTLP layer for logs, metrics, and traces.
Details
The layer sends data to /v1/logs, /v1/metrics, and /v1/traces below
baseUrl and requires an OtlpSerialization implementation.
The layer provides the OtlpExporter.Flusher shared by all three signals,
so one flush exports their buffered telemetry, for example before a
serverless instance is suspended.
Signature
declare function layer(options: { readonly baseUrl: string; readonly compression?: "none" | "gzip"; readonly headers?: Input; readonly loggerExcludeLogSpans?: boolean; readonly loggerExportInterval?: Input; readonly loggerMergeWithExisting?: boolean; readonly maxBatchSize?: number; readonly metricsExportInterval?: Input; readonly metricsTemporality?: AggregationTemporality; readonly resource?: { readonly attributes?: Record<string, unknown>; readonly serviceName?: string; readonly serviceVersion?: string; }; readonly shutdownTimeout?: Input; readonly tracerContext?: <X>(primitive: EffectPrimitive<X>, span: AnySpan) => X; readonly tracerExportInterval?: Input;}): Layer<Flusher, never, HttpClient | OtlpSerialization>layerFromConfig
unstableCreates a combined OTLP layer for logs, metrics, and traces from OpenTelemetry configuration.
Details
The layer provides the OtlpExporter.Flusher shared by all enabled signals.
It is provided even when configuration disables every signal, in which case
flush is a no-op.
Signature
declare function layerFromConfig(options?: { readonly headers?: Input; readonly loggerExcludeLogSpans?: boolean; readonly loggerMergeWithExisting?: boolean; readonly resource?: { readonly attributes?: Record<string, unknown>; readonly serviceName?: string; readonly serviceVersion?: string; }; readonly tracerContext?: <X>(primitive: EffectPrimitive<X>, span: AnySpan) => X;}): Layer<Flusher, never, HttpClient | OtlpSerialization>Creates the combined OTLP logs, metrics, and traces layer using JSON serialization.
Signature
declare const layerJson: (options: { readonly baseUrl: string; readonly compression?: "gzip" | "none"; readonly headers?: Headers.Input; readonly loggerExcludeLogSpans?: boolean; readonly loggerExportInterval?: Duration.Input; readonly loggerMergeWithExisting?: boolean; readonly maxBatchSize?: number; readonly metricsExportInterval?: Duration.Input; readonly metricsTemporality?: AggregationTemporality; readonly resource?: { readonly attributes?: Record<string, unknown>; readonly serviceName?: string; readonly serviceVersion?: string; }; readonly shutdownTimeout?: Duration.Input; readonly tracerContext?: <X>(primitive: Tracer.EffectPrimitive<X>, span: Tracer.AnySpan) => X; readonly tracerExportInterval?: Duration.Input;}) => Layer.Layer<OtlpExporter.Flusher, never, HttpClient.HttpClient>layerProtobuf
unstableCreates the combined OTLP logs, metrics, and traces layer using protobuf serialization.
Signature
declare const layerProtobuf: (options: { readonly baseUrl: string; readonly compression?: "gzip" | "none"; readonly headers?: Headers.Input; readonly loggerExcludeLogSpans?: boolean; readonly loggerExportInterval?: Duration.Input; readonly loggerMergeWithExisting?: boolean; readonly maxBatchSize?: number; readonly metricsExportInterval?: Duration.Input; readonly metricsTemporality?: AggregationTemporality; readonly resource?: { readonly attributes?: Record<string, unknown>; readonly serviceName?: string; readonly serviceVersion?: string; }; readonly shutdownTimeout?: Duration.Input; readonly tracerContext?: <X>(primitive: Tracer.EffectPrimitive<X>, span: Tracer.AnySpan) => X; readonly tracerExportInterval?: Duration.Input;}) => Layer.Layer<OtlpExporter.Flusher, never, HttpClient.HttpClient>