---
title: Socket
slug: telemetry-pipeline/socket
docTags: 
createdAt: 2025-04-21T01:03:23.211Z
---

## Socket Sink

### Overview

The **Socket sink** delivers logs, metrics, or traces to a remote socket endpoint using TCP, UDP, or Unix domain sockets. It is commonly used to forward telemetry data to custom collectors, legacy systems, or lightweight ingestion services that accept raw socket input.

This sink is stateless and optimized for streaming data with configurable buffering, encoding, framing, and optional end-to-end acknowledgements.

### Key Characteristics

- **Delivery:** Best effort&#x20;
- **Acknowledgements:** Supported (sink-level control)&#x20;
- **Egress:** Stream&#x20;
- **State:** Stateless&#x20;
- **Supported Inputs:** Logs, Metrics, Traces&#x20;
- **Supported Modes:** TCP, UDP, Unix stream, Unix datagram&#x20;

### Connection Modes

- **tcp** – Reliable, ordered delivery using TCP&#x20;
- **udp** – Fire-and-forget delivery with minimal overhead&#x20;
- **unix\_stream** – Stream-based Unix domain socket&#x20;
- **unix\_datagram** – Datagram-based Unix domain socket (Linux only)&#x20;

### Required Configuration

- **inputs**
  &#x20;List of upstream source or transform IDs.&#x20;
- **mode**
  &#x20;Socket type to use (tcp, udp, unix\_stream, unix\_datagram).&#x20;
- **address**
  &#x20;Target address in host\:port format (required for TCP/UDP).&#x20;
- **path**
  &#x20;Absolute Unix socket path (required for Unix socket modes).&#x20;
- **encoding.codec**
  &#x20;Defines how events are serialized before transmission.&#x20;

### Encoding

The Socket sink supports multiple encoding formats, including:

- json&#x20;
- text&#x20;
- raw\_message&#x20;
- csv&#x20;
- cef&#x20;
- gelf&#x20;
- protobuf&#x20;
- otlp&#x20;
- avro&#x20;

Encoding configuration determines which event types (logs, metrics, traces) are supported and how data is serialized on the wire.

### Framing

Framing controls how encoded events are delimited in the stream:

- newline\_delimited&#x20;
- character\_delimited&#x20;
- length\_delimited&#x20;
- varint\_length\_delimited&#x20;
- bytes (no framing)&#x20;

Framing is required for stream-based transports such as TCP and Unix stream sockets.

### Buffering

Optional buffering improves reliability and backpressure handling:

- **memory** – High performance, volatile&#x20;
- **disk** – Durable, survives restarts&#x20;

Behavior when full:

- block (default)&#x20;
- drop\_newest&#x20;

###

### TLS Support

For TCP mode, TLS can be enabled to secure data in transit:

- Certificate-based authentication&#x20;
- Optional hostname and certificate verification&#x20;
- ALPN protocol support
