Docs »

Automations »

Commands »

metric.increment

The metric.increment: command adds new samples to a metric.



start:
  metric.increment:
    inputs:
      metric_name: example.workerLogin.fails
      dimensions:
        worker@int: {{worker_id}}
        ip: {{client_ip}}
      values: 1
    output: results


Syntax

inputs:

Key  
metric_name: The metric name to add samples to
dimensions: An optional key/value dictionary for dimensions
values: A number, or array of numbers, for each sample. This defaults to 1 for counters if omitted
is_realtime@bool: If true the metric is updated instantly, otherwise (by default) it’s queued
timestamp@date: The optional timestamp for retroactive metrics. This defaults to now

output:

Save the metrics result to this placeholder.

on_simulate:

The commands to run during simulation instead of updating the metric.

If omitted, the metric is updated during simulation.

on_success:

The commands to run on success.

The output: placeholder contains an empty dictionary on success.

on_error:

The commands to run on failure. If omitted, the automation exits in the error state.

The output: placeholder receives a dictionary with these keys:

Key  
error The error message.