WASM Transform

The Vector wasm transform process events using the WASM virtual machine, allowing you to process Vector events with Typescript, Ruby, Java, and more.

Requirements

Configuration

[transforms.my_transform_id]
type = "wasm" # required
inputs = ["my-source-or-transform-id", "prefix-*"] # required
artifact_cache = "/etc/vector/artifacts" # required
module = "./modules/example.wasm" # required
  • commonrequiredstring

    artifact_cache

    The directory where Vector should store the artifact it builds of this WASM module. Typically, all WASM modules share this.

    This field accepts a valid file system path.

    • Syntax: file_system_path
  • optionaluint

    heap_max_size

    The maximum size of the heap of this module, in bytes. (This includes the module itself, default is 10 MB.)

    • Default: 10485760 (bytes)
  • commonrequiredstring

    module

    The file path of the .wasm or .wat module.

    This field accepts a valid file system path.

    • Syntax: file_system_path

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

    events_in_total

    The total number of events accepted 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.

  • counter

    processed_events_total

    The total number of events processed 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.

    • file - The file that produced 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.

  • counter

    processed_bytes_total

    The total number of bytes processed by the 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

State

This component is stateful, meaning its behavior changes based on previous inputs (events). State is not preserved across restarts, therefore state-dependent behavior will reset between restarts and depend on the inputs (events) received since the most recent restart.