Skip to content

Metric

Stores a collected server metric data point.

Metric is a multi-variant object: each instance has an @type discriminator selecting one of the variants below, and each variant carries its own set of fields.

Counter metric

Type: UnsignedInt · default: 0

Count associated with the metric

Type: MetricType · required

Metric event type

Type: UTCDateTime · required

Timestamp of the metric entry

Type: UnsignedInt · default: 0

Id of the cluster node that recorded the data point

Gauge metric

Type: UnsignedInt · default: 0

Count associated with the metric

Type: MetricType · required

Metric event type

Type: UTCDateTime · required

Timestamp of the metric entry

Type: UnsignedInt · default: 0

Id of the cluster node that recorded the data point

Histogram metric

Type: UnsignedInt · default: 0

Number of observations recorded since the previous data point from the same node

Type: UnsignedInt · default: 0

Sum of the observations recorded since the previous data point from the same node

Type: MetricType · required

Metric event type

Type: UTCDateTime · required

Timestamp of the metric entry

Type: UnsignedInt · default: 0

Id of the cluster node that recorded the data point

The Metric object is available via the urn:stalwart:jmap capability.

This is a standard Foo/get method as defined in RFC 8620, Section 5.1.

This method requires the sysMetricGet permission.

Terminal window
curl -X POST https://mail.example.com/jmap/ \
-H 'Authorization: Bearer $TOKEN' \
-H 'Content-Type: application/json' \
-d '{
"methodCalls": [
[
"x:Metric/get",
{
"ids": [
"id1"
]
},
"c1"
]
],
"using": [
"urn:ietf:params:jmap:core",
"urn:stalwart:jmap"
]
}'

This is a standard Foo/query method as defined in RFC 8620, Section 5.5.

This method requires the sysMetricQuery permission.

Terminal window
curl -X POST https://mail.example.com/jmap/ \
-H 'Authorization: Bearer $TOKEN' \
-H 'Content-Type: application/json' \
-d '{
"methodCalls": [
[
"x:Metric/query",
{
"filter": {
"nodeId": 1
}
},
"c1"
]
],
"using": [
"urn:ietf:params:jmap:core",
"urn:stalwart:jmap"
]
}'

The x:Metric/query filter argument accepts the following conditions (combinable with AnyOf / AllOf / Not per RFC 8620):

ConditionKind
nodeIdinteger

stalwart-cli wraps the same JMAP calls. See the CLI reference for installation, authentication, and general usage.

Terminal window
stalwart-cli get Metric id1
Terminal window
stalwart-cli query Metric
stalwart-cli query Metric --where nodeId=1