websocketprocessor

package module
v0.80.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jun 20, 2023 License: Apache-2.0 Imports: 20 Imported by: 1

README

Websocket Processor

Status
Stability development: logs, metrics, traces
Distributions []

The WebSocket processor, which can be positioned anywhere in a pipeline, allows data to pass through to the next component. Simultaneously, it makes a portion of the data accessible to WebSocket clients connecting on a configurable port. This functionality resembles that of the Unix tee command, which enables data to flow through while duplicating and redirecting it for inspection.

To avoid overloading clients, the amount of telemetry duplicated over any open WebSockets is rate limited by an adjustable amount.

Config

The WebSocket processor has two configurable fields: port and limit:

  • port: The port on which the WebSocket processor listens. Optional. Defaults to 12001.
  • limit: The rate limit over the WebSocket in messages per second. Can be a float or an integer. Optional. Defaults to 1.

Example configuration:

websocket:
  port: 12001
  limit: 1 # rate limit 1 msg/sec

Documentation

Overview

Package websocketprocessor can be positioned anywhere in a pipeline, allowing data to pass through to the next component. Simultaneously, it makes a portion of the data accessible to WebSocket clients connecting on a configurable port.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewFactory

func NewFactory() processor.Factory

Types

type Config

type Config struct {
	confighttp.HTTPServerSettings `mapstructure:",squash"` // squash ensures fields are correctly decoded in embedded struct

	// Limit is a float that indicates the maximum number of messages repeated
	// through the websocket by this processor in messages per second. Defaults to 1.
	Limit rate.Limit `mapstructure:"limit"`
}

Directories

Path Synopsis
internal

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL