Skip to main content

stdout

BETA

This component is mostly stable but breaking changes could still be made outside of major version releases if a fundamental problem with the component is found.

Prints aggregated metrics as JSON objects to stdout.

# Config fields, showing default values
metrics:
stdout:
push_interval: ""
static_fields:
'@service': benthos
flush_metrics: false
path_mapping: ""

When Benthos shuts down all aggregated metrics are printed. If a push_interval is specified then metrics are also printed periodically.

Fields​

push_interval​

An optional period of time to continuously print metrics.

Type: string
Default: ""

static_fields​

A map of static fields to add to each flushed metric object.

Type: object
Default: {"@service":"benthos"}

flush_metrics​

Whether counters and timing metrics should be reset to 0 each time metrics are printed.

Type: bool
Default: false

path_mapping​

An optional Bloblang mapping that allows you to rename or prevent certain metrics paths from being exported. When metric paths are created, renamed and dropped a trace log is written, enabling TRACE level logging is therefore a good way to diagnose path mappings.

Type: string
Default: ""

# Examples
path_mapping: this.replace("input", "source").replace("output", "sink")
path_mapping: |-
if ![
"benthos.input.received",
"benthos.input.latency",
"benthos.output.sent"
].contains(this) { deleted() }