---
title: Websocket
slug: telemetry-pipeline/websocket
docTags: 
createdAt: 2025-04-21T01:03:50.169Z
---

# WebSocket Sink

The **WebSocket sink** delivers logs, metrics, or traces to a remote WebSocket listener using a persistent, bidirectional connection. It is suitable for **real-time streaming** of observability data to custom services, dashboards, or intermediate processors.

## Core Sink Configuration

### type

**Required**
&#x20;Defines the sink type.

- Must be set to websocket.&#x20;
- Tells worker to open a WebSocket client connection and stream events.&#x20;

### inputs

**Required**
&#x20;List of upstream sources or transforms that send events to this sink.

- Accepts one or more component IDs.&#x20;
- Wildcards (\*) are supported.&#x20;

**Example**

:::BlockQuote
inputs:
&#x20; \- parse\_logs
&#x20; \- enrich\_metrics
:::

### uri

**Required**
&#x20;The WebSocket endpoint to connect to.

- Must include protocol (ws\:// or wss\://)&#x20;
- Can include host, port, path, query parameters&#x20;
- wss\:// **requires TLS to be enabled**&#x20;

**Example**

:::BlockQuote
uri: ws\://localhost:8080/ingest
:::

## Acknowledgements

### acknowledgements

**Optional**
&#x20;Controls end-to-end delivery acknowledgements.

This determines whether worker waits for downstream confirmation before acknowledging events at the source.

### acknowledgements.enabled

**Optional**
&#x20;Enables or disables end-to-end acknowledgements.

- When true, worker waits until **all connected sinks acknowledge an event**&#x20;
- Takes precedence over global acknowledgement settings&#x20;
- Only effective if upstream sources support acknowledgements&#x20;

**Default behavior**

- Disabled unless explicitly enabled&#x20;

**Example**

:::BlockQuote
acknowledgements:
&#x20; enabled: true
:::

## Authentication (auth)

The WebSocket sink supports **HTTP-style authentication headers** during the WebSocket handshake.

### auth.strategy

**Required (when auth is used)**
&#x20;Defines the authentication method.

Supported values:

- aws – AWS SigV4 signing&#x20;
- basic – HTTP Basic Authentication&#x20;
- bearer – Bearer token (OAuth2, JWT, etc.)&#x20;
- custom – Custom Authorization header value&#x20;

### Basic Authentication

auth.user

**Required**
&#x20;Username for basic authentication.

auth.password

**Required**
&#x20;Password for basic authentication.

**Example**

:::BlockQuote
auth:
&#x20; strategy: basic
&#x20; user: admin
&#x20; password: secret
:::

### Bearer Authentication

auth.token

**Required**
&#x20;Bearer token value passed as-is.

**Example**

:::BlockQuote
auth:
&#x20; strategy: bearer
&#x20; token: eyJhbGciOiJIUzI1NiIs...
:::

### Custom Authorization Header

auth.value

**Required**
&#x20;Full value of the Authorization header.

**Example**

:::BlockQuote
auth:
&#x20; strategy: custom
&#x20; value: "ApiKey abc123"
:::

### AWS Authentication (strategy = "aws")

Used when connecting to AWS-backed WebSocket endpoints requiring SigV4.

auth.service

AWS service name used for signing (e.g. execute-api).

auth.auth.access\_key\_id

AWS access key ID.

auth.auth.secret\_access\_key

AWS secret access key.

auth.auth.session\_token

Optional temporary session token.

auth.auth.region

AWS region used for STS requests.

auth.auth.assume\_role

IAM role ARN to assume.

auth.auth.session\_name

Optional session identifier.

auth.auth.credentials\_file

Path to AWS credentials file.

auth.auth.profile

Credentials profile name.

auth.auth.external\_id

External ID for role assumption.

### IMDS Configuration (AWS)

auth.auth.imds

Controls AWS IMDS authentication behavior.

- connect\_timeout\_seconds&#x20;
- read\_timeout\_seconds&#x20;
- max\_attempts&#x20;

Used when credentials are fetched dynamically from EC2 metadata.

## Buffer Configuration

### buffer

**Optional**
&#x20;Controls how events are queued before being sent.

### buffer.type

**Optional**
&#x20;Buffer storage type.

- memory (default) – Fast, volatile&#x20;
- disk – Durable, slower&#x20;

### buffer.max\_events

**Optional**
&#x20;Maximum number of events in memory buffer.

- Only applies to memory buffers&#x20;
- Default: 500&#x20;

### buffer.max\_size

**Required**
&#x20;Maximum memory or disk space the buffer can consume.

- Disk buffers must be **≥ \~256MB**&#x20;

### buffer.when\_full

**Optional**
&#x20;Behavior when the buffer is full.

- block (default) – Apply backpressure&#x20;
- drop\_newest – Drop incoming events&#x20;

## Encoding

### encoding

**Required**
&#x20;Defines how events are serialized before sending.

The selected codec determines which input types (logs, metrics, traces) are supported.

### encoding.codec

**Required**
&#x20;Serialization format.

Supported codecs include:

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

### JSON Encoding

encoding.json.pretty

Pretty-print JSON output.

- Default: false&#x20;

### CSV Encoding

encoding.csv.fields

Ordered list of fields to encode.

encoding.csv.delimiter

Field delimiter (default: ,).

encoding.csv.quote\_style

Controls quoting behavior (necessary, always, never, non\_numeric).

### CEF Encoding

Includes:

- device\_vendor&#x20;
- device\_product&#x20;
- device\_version&#x20;
- device\_event\_class\_id&#x20;
- name&#x20;
- severity&#x20;
- extensions&#x20;

Used mainly for SIEM integrations.

### Protobuf Encoding

encoding.protobuf.desc\_file

Path to descriptor set file generated by protoc.

encoding.protobuf.message\_type

Protobuf message type to serialize.

encoding.protobuf.use\_json\_names

Use camelCase field names instead of snake\_case.

### Timestamp Formatting

encoding.timestamp\_format

Controls timestamp representation.

Options:

- rfc3339&#x20;
- unix&#x20;
- unix\_ms&#x20;
- unix\_us&#x20;
- unix\_ns&#x20;
- unix\_float&#x20;

##

## WebSocket Keepalive

### ping\_interval

**Optional**
&#x20;Interval (seconds) between WebSocket ping frames.

- Helps detect dead connections&#x20;

### ping\_timeout

**Optional**
&#x20;Time to wait for a pong response.

- If exceeded, connection is re-established&#x20;
- Ignored if ping\_interval is not set&#x20;

## TLS Configuration

### tls.enabled

**Optional**
&#x20;Enables TLS encryption.

- Required for wss\:// URIs&#x20;

### tls.ca\_file

Additional CA certificates.

### tls.crt\_file

Client/server identity certificate.

### tls.key\_file

Private key for the certificate.

### tls.key\_pass

Passphrase for encrypted private keys.

### tls.server\_name

SNI hostname used during TLS handshake.

### tls.verify\_certificate

Enables certificate chain validation.

### tls.verify\_hostname

Validates hostname against certificate SAN/CN.
