NATS
Publish observability data to subjects on the NATS messaging system
Configuration
Example configurations
{
"sinks": {
"my_sink_id": {
"type": "nats",
"inputs": [
"my-source-or-transform-id"
],
"url": "nats://demo.nats.io",
"subject": "{{ host }}",
"encoding": {
"codec": "json"
},
"healthcheck": null
}
}
}
[sinks.my_sink_id]
type = "nats"
inputs = [ "my-source-or-transform-id" ]
url = "nats://demo.nats.io"
subject = "{{ host }}"
[sinks.my_sink_id.encoding]
codec = "json"
---
sinks:
my_sink_id:
type: nats
inputs:
- my-source-or-transform-id
url: nats://demo.nats.io
subject: "{{ host }}"
encoding:
codec: json
healthcheck: null
{
"sinks": {
"my_sink_id": {
"type": "nats",
"inputs": [
"my-source-or-transform-id"
],
"url": "nats://demo.nats.io",
"subject": "{{ host }}",
"connection_name": "vector",
"buffer": null,
"encoding": {
"codec": "json"
},
"healthcheck": null,
"tls": null,
"auth": null
}
}
}
[sinks.my_sink_id]
type = "nats"
inputs = [ "my-source-or-transform-id" ]
url = "nats://demo.nats.io"
subject = "{{ host }}"
connection_name = "vector"
[sinks.my_sink_id.encoding]
codec = "json"
---
sinks:
my_sink_id:
type: nats
inputs:
- my-source-or-transform-id
url: nats://demo.nats.io
subject: "{{ host }}"
connection_name: vector
buffer: null
encoding:
codec: json
healthcheck: null
tls: null
auth: null
auth
optional objectauth.credentials_file
optional objectcredentials_file
.auth.credentials_file.path
optional string literalauth.nkey
optional objectnkey
.auth.nkey.nkey
optional string literalauth.nkey.seed
optional string literalauth.strategy
optional string literal enumOption | Description |
---|---|
credentials_file | Credentials file authentication: https://docs.nats.io/running-a-nats-service/configuration/securing_nats/auth_intro/jwt |
nkey | Nkey authentication: https://docs.nats.io/running-a-nats-service/configuration/securing_nats/auth_intro/nkey_auth |
token | Token authentication: https://docs.nats.io/running-a-nats-service/configuration/securing_nats/auth_intro/tokens |
user_password | Username and password authentication: https://docs.nats.io/running-a-nats-service/configuration/securing_nats/auth_intro/username_password |
user_password
auth.user_password
optional objectuser_password
.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.
subject
required string templatetls
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
url
required string literalnats://server:port
.Telemetry
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
.events_discarded_total
counterevents_in_total
countercomponent_received_events_total
instead.component_id
instead. The value is the same as component_id
.processed_bytes_total
countercomponent_id
instead. The value is the same as component_id
.processed_events_total
countercomponent_received_events_total
and
component_sent_events_total
metrics.component_id
instead. The value is the same as component_id
.processing_errors_total
countercomponent_id
instead. The value is the same as component_id
.send_errors_total
countercomponent_id
instead. The value is the same as component_id
.utilization
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
.nats.rs
nats
source/sink uses nats.rs
under the hood.