Websocket
Deliver observability event data to a websocket listener
Configuration
Example configurations
{
"sinks": {
"my_sink_id": {
"type": "websocket",
"inputs": [
"my-source-or-transform-id"
],
"uri": "ws://127.0.0.1:9000/endpoint",
"ping_interval": null,
"encoding": {
"codec": "json"
},
"healthcheck": null,
"ping_timeout": null
}
}
}
[sinks.my_sink_id]
type = "websocket"
inputs = [ "my-source-or-transform-id" ]
uri = "ws://127.0.0.1:9000/endpoint"
[sinks.my_sink_id.encoding]
codec = "json"
---
sinks:
my_sink_id:
type: websocket
inputs:
- my-source-or-transform-id
uri: ws://127.0.0.1:9000/endpoint
ping_interval: null
encoding:
codec: json
healthcheck: null
ping_timeout: null
{
"sinks": {
"my_sink_id": {
"type": "websocket",
"inputs": [
"my-source-or-transform-id"
],
"uri": "ws://127.0.0.1:9000/endpoint",
"ping_interval": null,
"buffer": null,
"encoding": {
"codec": "json"
},
"healthcheck": null,
"tls": null,
"ping_timeout": null
}
}
}
[sinks.my_sink_id]
type = "websocket"
inputs = [ "my-source-or-transform-id" ]
uri = "ws://127.0.0.1:9000/endpoint"
[sinks.my_sink_id.encoding]
codec = "json"
---
sinks:
my_sink_id:
type: websocket
inputs:
- my-source-or-transform-id
uri: ws://127.0.0.1:9000/endpoint
ping_interval: null
buffer: null
encoding:
codec: json
healthcheck: null
tls: null
ping_timeout: null
buffer
optional objectbuffer.max_events
common optional uinttype = "memory"
500
(events)buffer.max_size
required uintThe maximum size of the buffer on the disk. Must be at least 128 megabytes (134217728 bytes).
Note that during normal disk buffer operation, the disk buffer can create one additional 128 megabyte block so the minimum disk space required is actually 256 megabytes.
type = "disk"
buffer.type
common optional string literal enumOption | Description |
---|---|
disk | Stores the sink’s buffer on disk. This is less performant, but durable. Data will not be lost between restarts. Will also hold data in memory to enhance performance. WARNING: This may stall the sink if disk performance isn’t on par with the throughput. For comparison, AWS gp2 volumes are usually too slow for common cases. |
memory | Stores the sink’s buffer in memory. This is more performant, but less durable. Data will be lost if Vector is restarted forcefully. |
memory
buffer.when_full
optional string literal enumOption | Description |
---|---|
block | Applies back pressure when the buffer is full. This prevents data loss, but will cause data to pile up on the edge. |
drop_newest | Drops new data as it’s received. This data is lost. This should be used when performance is the highest priority. |
block
encoding
required objectConfigures the encoding specific sink behavior.
Note: When data in encoding
is malformed, currently only a very generic error “data did not match any variant of untagged enum EncodingConfig” is reported. Follow this issue to track progress on improving these error messages.
encoding.codec
required string literal enumOption | Description |
---|---|
json | JSON encoded event. |
text | The message field from the event. |
encoding.except_fields
optional [string]encoding.only_fields
optional [string]encoding.timestamp_format
optional string literal enumOption | Description |
---|---|
rfc3339 | Formats as a RFC3339 string |
unix | Formats as a unix timestamp |
rfc3339
healthcheck
common optional objecthealthcheck.enabled
common optional booltrue
inputs
required [string]A list of upstream source or transform
IDs. Wildcards (*
) are supported.
See configuration for more info.
ping_interval
common optional uintping_timeout
common optional uintping_interval is set
tls
optional objecttls.ca_file
optional string literaltls.crt_file
common optional string literalkey_file
must also be set.tls.key_file
common optional string literalcrt_file
must also be set.tls.key_pass
optional string literalkey_file
is set.tls.verify_certificate
optional booltrue
(the default), Vector will validate the TLS certificate of the remote host.true
tls.verify_hostname
optional booltrue
(the default), Vector will validate the configured remote host name against the remote host’s TLS certificate. Do NOT set this to false
unless you understand the risks of not verifying the remote hostname.true
uri
required string literalTelemetry
Metrics
linkbuffer_byte_size
gaugecomponent_id
instead. The value is the same as component_id
.buffer_discarded_events_total
countercomponent_id
instead. The value is the same as component_id
.buffer_events
gaugecomponent_id
instead. The value is the same as component_id
.buffer_received_event_bytes_total
countercomponent_id
instead. The value is the same as component_id
.buffer_received_events_total
countercomponent_id
instead. The value is the same as component_id
.buffer_sent_event_bytes_total
countercomponent_id
instead. The value is the same as component_id
.buffer_sent_events_total
countercomponent_id
instead. The value is the same as component_id
.component_received_event_bytes_total
countercomponent_id
instead. The value is the same as component_id
.component_received_events_count
histogramcomponent_id
instead. The value is the same as component_id
.component_received_events_total
countercomponent_id
instead. The value is the same as component_id
.component_sent_bytes_total
countercomponent_id
instead. The value is the same as component_id
.component_sent_event_bytes_total
countercomponent_id
instead. The value is the same as component_id
.component_sent_events_total
countercomponent_id
instead. The value is the same as component_id
.connection_errors_total
counterconnection_established_total
counterconnection_failed_total
counterconnection_shutdown_total
counterevents_in_total
countercomponent_received_events_total
instead.component_id
instead. The value is the same as component_id
.events_out_total
countercomponent_sent_events_total
instead.component_id
instead. The value is the same as component_id
.open_connections
gaugeutilization
gaugecomponent_id
instead. The value is the same as component_id
.How it works
Health checks
Require health checks
If you’d like to exit immediately upon a health check failure, you can pass the
--require-healthy
flag:
vector --config /etc/vector/vector.toml --require-healthy
Disable health checks
healthcheck
option to
false
.