Skip to main content
Version: 2.0.0

metrics

const metrics: Metrics

What

metrics is an instance of the Metrics class. It is automatically created when a deployment is started. It provides methods to interact with various types of metrics like counters.

How to use

Please check the Metrics documentation for more information.

Example

// Retrieve a counter named 'Counter.Workflow.*.Instances'
const signalCount = metrics.getCounter('Counter.Signals.*.MyCounter');

// Increment the counter by 1
signalCount.increment();

// Decrement the counter by 1
signalCount.decrement();

Global

Constant