Skip to content

stratumctl metrics

Custom metrics (PutMetricData)

Terminal window
stratumctl metrics [flags]

Publish one custom metric sample

Terminal window
stratumctl metrics put [flags]

Publishes one sample of an application metric. It is stored as custom_<namespace>:<metric-name> with the dimensions as labels, and the project stamped by the server, so it can be queried back and alarmed on in this project only. Many samples at once: POST…/observability/metrics/actions/put-metric-data.

Terminal window
stratumctl metrics put --namespace MyApp --metric-name QueueDepth --value 17 --dimension queue=orders
Flag Type Default Description
--dimension stringArray A dimension key=value (repeatable, at most 10)
--metric-name string Metric name, e.g. QueueDepth (required)
--namespace string Namespace, e.g. MyApp (required)
--project string Project ID (defaults to STRATUM_PROJECT or profile project_id)
--timestamp string RFC 3339 time of the measurement (default now)
--value float64 0 The value