NATS

Read observability data from subjects on the NATS messaging system

status: beta role: aggregator delivery: best effort egress: stream state: stateless output: log

Configuration

Example configurations

{
  "sources": {
    "my_source_id": {
      "type": "nats",
      "url": "nats://demo.nats.io",
      "subject": "{{ host }}"
    }
  }
}
[sources.my_source_id]
type = "nats"
url = "nats://demo.nats.io"
subject = "{{ host }}"
---
sources:
  my_source_id:
    type: nats
    url: nats://demo.nats.io
    subject: "{{ host }}"
{
  "sources": {
    "my_source_id": {
      "type": "nats",
      "url": "nats://demo.nats.io",
      "subject": "{{ host }}",
      "queue": "vector",
      "connection_name": "vector"
    }
  }
}
[sources.my_source_id]
type = "nats"
url = "nats://demo.nats.io"
subject = "{{ host }}"
queue = "vector"
connection_name = "vector"
---
sources:
  my_source_id:
    type: nats
    url: nats://demo.nats.io
    subject: "{{ host }}"
    queue: vector
    connection_name: vector

connection_name

optional string literal
A name assigned to the NATS connection.
Examples
"foo"
"API Name Option Example"
default: vector

queue

optional string literal
NATS Queue Group to join
Examples
"foo"
"API Name Option Example"
default: vector

subject

required string template
The NATS subject to publish messages to.
Note: This parameter supports Vector's template syntax, which enables you to use dynamic per-event values.
Examples
"{{ host }}"
"foo"
"time.us.east"
"time.*.east"
"time.\u003e"
"\u003e"

url

required string literal
The NATS URL to connect to. The url must take the form of nats://server:port.
Examples
"nats://demo.nats.io"
"nats://127.0.0.1:4222"

Output

Logs

Record

An individual NATS record
Fields
message required string literal
The raw line from the NATS message.
Examples
53.126.150.246 - - [01/Oct/2020:11:25:58 -0400] "GET /disintermediate HTTP/2.0" 401 20308

Telemetry

Metrics

link

events_out_total

counter
The total number of events emitted by this component.
component_id required
The Vector component ID.
component_kind required
The Vector component kind.
component_name required
Deprecated, use component_id instead. The value is the same as component_id.
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_id required
The Vector component ID.
component_kind required
The Vector component kind.
component_name required
Deprecated, use component_id instead. The value is the same as component_id.
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_id required
The Vector component ID.
component_kind required
The Vector component kind.
component_name required
Deprecated, use component_id instead. The value is the same as component_id.
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.

utilization

gauge
A ratio from 0 to 1 of the load on a component. A value of 0 would indicate a completely idle component that is simply waiting for input. A value of 1 would indicate a that is never idle. This value is updated every 5 seconds.
component_id required
The Vector component ID.
component_kind required
The Vector component kind.
component_name required
Deprecated, use component_id instead. The value is the same as component_id.
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

Context

By default, the nats source augments events with helpful context keys.

nats.rs

The nats source/sink uses nats.rs under the hood.

State

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