Sematext metrics

Publish metric events to Sematext

status: beta delivery: at-least-once egress: batch state: stateless

Warnings

Sematext monitoring only accepts metrics which contain a single value. Therefore, only counter and gauge metrics are supported. If you’d like to ingest other metric types please consider using the metric_to_log transform with the sematext_logs sink.

Configuration

Example configurations

{
  "sinks": {
    "my_sink_id": {
      "type": "sematext_metrics",
      "inputs": "my-source-or-transform-id",
      "region": "us",
      "default_namespace": "service",
      "token": "${SEMATEXT_TOKEN}"
    }
  }
}
[sinks.my_sink_id]
type = "sematext_metrics"
inputs = "my-source-or-transform-id"
region = "us"
default_namespace = "service"
token = "${SEMATEXT_TOKEN}"
---
sinks:
  my_sink_id:
    type: sematext_metrics
    inputs: my-source-or-transform-id
    region: us
    default_namespace: service
    encoding: null
    healthcheck: null
    token: ${SEMATEXT_TOKEN}
{
  "sinks": {
    "my_sink_id": {
      "type": "sematext_metrics",
      "inputs": "my-source-or-transform-id",
      "endpoint": "http://127.0.0.1",
      "region": "us",
      "default_namespace": "service",
      "token": "${SEMATEXT_TOKEN}"
    }
  }
}
[sinks.my_sink_id]
type = "sematext_metrics"
inputs = "my-source-or-transform-id"
endpoint = "http://127.0.0.1"
region = "us"
default_namespace = "service"
token = "${SEMATEXT_TOKEN}"
---
sinks:
  my_sink_id:
    type: sematext_metrics
    inputs: my-source-or-transform-id
    endpoint: http://127.0.0.1
    region: us
    default_namespace: service
    buffer: null
    batch: null
    encoding: null
    healthcheck: null
    proxy: null
    token: ${SEMATEXT_TOKEN}

batch

optional object
Configures the sink batching behavior.

batch.max_bytes

optional uint
The maximum size of a batch, in bytes, before it is flushed.
default: 3e+07 (bytes)

batch.timeout_secs

optional uint
The maximum age of a batch before it is flushed.
default: 1 (seconds)

buffer

optional object
Configures the sink specific buffer behavior.

buffer.max_events

optional uint
The maximum number of events allowed in the buffer.
Relevant when: type = "memory"
default: 500 (events)

buffer.max_size

required uint
The maximum size of the buffer on the disk.
Relevant when: type = "disk"

buffer.type

optional string enum literal
The buffer’s type and storage mechanism.
Enum options
OptionDescription
diskStores 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.
memoryStores the sink’s buffer in memory. This is more performant, but less durable. Data will be lost if Vector is restarted forcefully.
default: memory

buffer.when_full

optional string enum literal
The behavior when the buffer becomes full.
Enum options
OptionDescription
blockApplies back pressure when the buffer is full. This prevents data loss, but will cause data to pile up on the edge.
drop_newestDrops new data as it’s received. This data is lost. This should be used when performance is the highest priority.
default: block

default_namespace

required string
Used as a namespace for metrics that don’t have it.

encoding

required object
Configures the encoding specific sink behavior.

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

endpoint

optional string
The endpoint to send data to.

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-*"
]

proxy

optional object
Configures an HTTP(S) proxy for Vector to use.

proxy.enabled

optional bool
If false the proxy will be disabled.
default: true

proxy.http

optional string literal
The URL to proxy HTTP requests through.

proxy.https

optional string literal
The URL to proxy HTTPS requests through.

proxy.no_proxy

optional array

List of hosts to avoid proxying globally.

Allowed patterns here include: - Domain names. For example, example.com will match requests to to example.com - Wildcard domains. For example, .example.com will match requests to example.com and its subdomains - IP addresses. For example, 127.0.0.1 will match requests to 127.0.0.1 - CIDR blocks. For example, 192.168.0.0./16 will match requests to any IP addresses in this range - * will match all hosts

region

required string enum
The region to send data to.
Enum options string literal
OptionDescription
euEurope
usUnited States

token

required string
The token that will be used to write to Sematext.

Telemetry

Metrics

link

encode_errors_total

counter
The total number of errors encountered when encoding an event.
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.

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.

How it works

Buffers and batches

This component buffers & batches data as shown in the diagram above. You’ll notice that Vector treats these concepts differently, instead of treating them as global concepts, Vector treats them as sink specific concepts. This isolates sinks, ensuring services disruptions are contained and delivery guarantees are honored.

Batches are flushed when 1 of 2 conditions are met:

  1. The batch age meets or exceeds the configured timeout_secs.
  2. The batch size meets or exceeds the configured max_size or max_events.

Buffers are controlled via the buffer.* options.

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.