Sematext Metrics Sink

The Vector sematext_metrics sink sends metrics to Sematext.

Warnings

Configuration

[sinks.my_sink_id]
# General
type = "sematext_metrics" # required
inputs = ["my-source-or-transform-id", "prefix-*"] # required
default_namespace = "service" # required
region = "us" # required, required when endpoint is not set
token = "${SEMATEXT_TOKEN}" # required
# Encoding
# Healthcheck
healthcheck.enabled = true # optional, default
  • optionaltable

    batch

    Configures the sink batching behavior.

    • commonoptionaluint

      max_bytes

      The maximum size of a batch, in bytes, before it is flushed.

      • Default: 30000000 (bytes)
    • commonoptionaluint

      timeout_secs

      The maximum age of a batch before it is flushed. See Buffers & batches for more info.

      • Default: 1 (seconds)
  • optionaltable

    buffer

    Configures the sink specific buffer behavior.

    • commonoptionaluint

      max_events

      The maximum number of events allowed in the buffer. See Buffers & batches for more info.

      • Only relevant when: type = "memory"
      • Default: 500 (events)
    • commonrequired*uint

      max_size

      The maximum size of the buffer on the disk. See Buffers & batches for more info.

      • Only required when: type = "disk"
    • enumcommonoptionalstring

      type

      The buffer's type and storage mechanism.

      • Syntax: literal
      • Default: "memory"
      • Enum, must be one of: "memory" "disk"
    • enumoptionalstring

      when_full

      The behavior when the buffer becomes full.

      • Syntax: literal
      • Default: "block"
      • Enum, must be one of: "block" "drop_newest"
  • commonrequiredstring

    default_namespace

    Used as a namespace for metrics that don't have it.

    • Syntax: literal
  • commonrequiredtable

    encoding

    Configures the encoding specific sink behavior.

    • optional[string]

      except_fields

      Prevent the sink from encoding the specified fields.

    • optional[string]

      only_fields

      Prevent the sink from encoding the specified fields.

    • enumoptionalstring

      timestamp_format

      How to format event timestamps.

      • Syntax: literal
      • Default: "rfc3339"
      • Enum, must be one of: "rfc3339" "unix"
  • optionalstring

    endpoint

    The endpoint to send data to.

    • Syntax: literal
    • Only relevant when: region is not set
  • commonoptionaltable

    healthcheck

    Health check options for the sink. See Health checks for more info.

    • commonoptionalbool

      enabled

      Enables/disables the healthcheck upon Vector boot.

      • Default: true
  • enumcommonrequired*string

    region

    The region to send data to.

    • Syntax: literal
    • Only required when: endpoint is not set
    • Enum, must be one of: "us" "eu"
  • commonrequiredstring

    token

    The token that will be used to write to Sematext.

    • Syntax: literal

Telemetry

This component provides the following metrics that can be retrieved through the internal_metrics source. See the metrics section in the monitoring page for more info.

  • counter

    encode_errors_total

    The total number of errors encountered when encoding an event. This metric includes the following tags:

    • instance - The Vector instance identified by host and port.

    • job - The name of the job producing Vector metrics.

  • counter

    events_in_total

    The number of events accepted by this component either from tagged origin like file and uri, or cumulatively from other origins. This metric includes the following tags:

    • component_kind - The Vector component kind.

    • component_name - The Vector component ID.

    • component_type - The Vector component type.

    • container_name - The name of the container from which the event originates.

    • file - The file from which the event originates.

    • instance - The Vector instance identified by host and port.

    • job - The name of the job producing Vector metrics.

    • mode - The connection mode used by the component.

    • peer_addr - The IP from which the event originates.

    • peer_path - The pathname from which the event originates.

    • pod_name - The name of the pod from which the event originates.

    • uri - The sanitized uri from which the event originates.

  • counter

    processing_errors_total

    The total number of processing errors encountered by this component. This metric includes the following tags:

    • component_kind - The Vector component kind.

    • component_name - The Vector component ID.

    • component_type - The Vector component type.

    • error_type - The type of the error

    • instance - The Vector instance identified by host and port.

    • job - The name of the job producing Vector metrics.

  • counter

    events_out_total

    The total number of events emitted by this component. This metric includes the following tags:

    • component_kind - The Vector component kind.

    • component_name - The Vector component ID.

    • component_type - The Vector component type.

    • instance - The Vector instance identified by host and port.

    • job - The name of the job producing Vector metrics.

How It Works

Buffers & 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 <% if component.options.batch.children.respond_to?(:max_size) %>max_size<% else %>max_events<% end %>.

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.