Skip to content

OtlpSerialization

Serializes OTLP payloads into HTTP request bodies.

Signal exporters build trace, metric, and log data structures in memory. This module provides the service that turns those structures into JSON or protobuf HTTP bodies before they are posted to an OTLP collector.

3 exports Added in v4.0.0 Source

Layers

layerJson

Added in v4.0.0 Source

Provides OtlpSerialization using OTLP/HTTP JSON bodies.

Signature

declare const layerJson: Layer<OtlpSerialization, never, never>;

Provides OtlpSerialization using protobuf-encoded OTLP bodies with the application/x-protobuf content type.

Signature

declare const layerProtobuf: Layer<OtlpSerialization, never, never>;

Services

Service for serializing OTLP traces, metrics, and logs into HTTP request bodies.

Signature

declare class OtlpSerialization extends Shape<
  "effect/observability/OtlpSerialization",
  {
    readonly logs: (data: LogsData) => HttpBody;
    readonly metrics: (data: MetricsData) => HttpBody;
    readonly traces: (data: TraceData) => HttpBody;
  },
  this
> {
  constructor(_: never);
}