NATS

Publish observability data to subjects on the NATS messaging system

status: beta delivery: best effort egress: stream state: stateless

Configuration

Example configurations

{
  "sinks": {
    "my_sink_id": {
      "type": "nats",
      "inputs": "my-source-or-transform-id",
      "url": "nats://demo.nats.io",
      "subject": "{{ host }}"
    }
  }
}
[sinks.my_sink_id]
type = "nats"
inputs = "my-source-or-transform-id"
url = "nats://demo.nats.io"
subject = "{{ host }}"
---
sinks:
  my_sink_id:
    type: nats
    inputs: my-source-or-transform-id
    url: nats://demo.nats.io
    subject: "{{ host }}"
    encoding: null
    healthcheck: null
{
  "sinks": {
    "my_sink_id": {
      "type": "nats",
      "inputs": "my-source-or-transform-id",
      "url": "nats://demo.nats.io",
      "subject": "{{ host }}",
      "name": "vector"
    }
  }
}
[sinks.my_sink_id]
type = "nats"
inputs = "my-source-or-transform-id"
url = "nats://demo.nats.io"
subject = "{{ host }}"
name = "vector"
---
sinks:
  my_sink_id:
    type: nats
    inputs: my-source-or-transform-id
    url: nats://demo.nats.io
    subject: "{{ host }}"
    encoding: null
    healthcheck: null
    name: vector

encoding

required object
Configures the encoding specific sink behavior.

encoding.codec

required string literal
The encoding codec used to serialize the events before outputting.

encoding.except_fields

optional array
Prevent the sink from encoding the specified fields.

encoding.only_fields

optional array
Makes the sink encode only the specified fields.

encoding.timestamp_format

optional string enum literal
How to format event timestamps.
Enum options
OptionDescription
rfc3339Formats as a RFC3339 string
unixFormats as a unix timestamp
default: rfc3339

healthcheck

common optional object
Health check options for the sink.

healthcheck.enabled

optional bool
Enables/disables the healthcheck upon Vector boot.
default: true

inputs

required [string]

A list of upstream source or transform IDs. Wildcards (*) are supported but must be the last character in the ID.

See configuration for more info.

Array string literal
Examples
[
  "my-source-or-transform-id",
  "prefix-*"
]

name

optional string
A name assigned to the NATS connection.
default: vector

subject

required string
The NATS subject to publish messages to.

url

required string
The NATS URL to connect to. The url must take the form of nats://server:port.

Telemetry

Metrics

link

events_discarded_total

counter
The total number of events discarded by this component.
host required
The hostname of the system Vector is running on.
pid required
The process ID of the Vector instance.

events_in_total

counter
The number of events accepted by this component either from tagged origin like file and uri, or cumulatively from other origins.
component_kind required
The Vector component kind.
component_name required
The Vector component name.
component_type required
The Vector component type.
container_name optional
The name of the container from which the event originates.
file optional
The file from which the event originates.
host required
The hostname of the system Vector is running on.
mode optional
The connection mode used by the component.
peer_addr optional
The IP from which the event originates.
peer_path optional
The pathname from which the event originates.
pid required
The process ID of the Vector instance.
pod_name optional
The name of the pod from which the event originates.
uri optional
The sanitized URI from which the event originates.

events_out_total

counter
The total number of events emitted by this component.
component_kind required
The Vector component kind.
component_name required
The Vector component name.
component_type required
The Vector component type.
host required
The hostname of the system Vector is running on.
pid required
The process ID of the Vector instance.

processed_bytes_total

counter
The number of bytes processed by the component.
component_kind required
The Vector component kind.
component_name required
The Vector component name.
component_type required
The Vector component type.
container_name optional
The name of the container from which the bytes originate.
file optional
The file from which the bytes originate.
host required
The hostname of the system Vector is running on.
mode optional
The connection mode used by the component.
peer_addr optional
The IP from which the bytes originate.
peer_path optional
The pathname from which the bytes originate.
pid required
The process ID of the Vector instance.
pod_name optional
The name of the pod from which the bytes originate.
uri optional
The sanitized URI from which the bytes originate.

processed_events_total

counter
The total number of events processed by this component. This metric is deprecated in place of using events_in_total and events_out_total metrics.
component_kind required
The Vector component kind.
component_name required
The Vector component name.
component_type required
The Vector component type.
host required
The hostname of the system Vector is running on.
pid required
The process ID of the Vector instance.

processing_errors_total

counter
The total number of processing errors encountered by this component.
component_kind required
The Vector component kind.
component_name required
The Vector component name.
component_type required
The Vector component type.
error_type required
The type of the error
host required
The hostname of the system Vector is running on.
pid required
The process ID of the Vector instance.

send_errors_total

counter
The total number of errors sending messages.
component_kind required
The Vector component kind.
component_name required
The Vector component name.
component_type required
The Vector component type.
host required
The hostname of the system Vector is running on.
pid required
The process ID of the Vector instance.

How it works

Health checks

Health checks ensure that the downstream service is accessible and ready to accept data. This check is performed upon sink initialization. If the health check fails an error will be logged and Vector will proceed to start.

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

If you’d like to disable health checks for this sink you can set the healthcheck option to false.

State

This component is stateless, meaning its behavior is consistent across each input.