Metric
Stores a collected server metric data point.
Fields
Section titled “Fields”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.
@type: "Counter"
Section titled “@type: "Counter"”Counter metric
Type:
UnsignedInt· default:0Count associated with the metric
metric
Section titled “metric”Type:
MetricType· requiredMetric event type
timestamp
Section titled “timestamp”Type:
UTCDateTime· requiredTimestamp of the metric entry
nodeId
Section titled “nodeId”Type:
UnsignedInt· default:0Id of the cluster node that recorded the data point
@type: "Gauge"
Section titled “@type: "Gauge"”Gauge metric
Type:
UnsignedInt· default:0Count associated with the metric
metric
Section titled “metric”Type:
MetricType· requiredMetric event type
timestamp
Section titled “timestamp”Type:
UTCDateTime· requiredTimestamp of the metric entry
nodeId
Section titled “nodeId”Type:
UnsignedInt· default:0Id of the cluster node that recorded the data point
@type: "Histogram"
Section titled “@type: "Histogram"”Histogram metric
Type:
UnsignedInt· default:0Number of observations recorded since the previous data point from the same node
Type:
UnsignedInt· default:0Sum of the observations recorded since the previous data point from the same node
metric
Section titled “metric”Type:
MetricType· requiredMetric event type
timestamp
Section titled “timestamp”Type:
UTCDateTime· requiredTimestamp of the metric entry
nodeId
Section titled “nodeId”Type:
UnsignedInt· default:0Id of the cluster node that recorded the data point
JMAP API
Section titled “JMAP API”The Metric object is available via the urn:stalwart:jmap capability.
x:Metric/get
Section titled “x:Metric/get”This is a standard Foo/get method as defined in RFC 8620, Section 5.1.
This method requires the sysMetricGet permission.
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" ] }'x:Metric/query
Section titled “x:Metric/query”This is a standard Foo/query method as defined in RFC 8620, Section 5.5.
This method requires the sysMetricQuery permission.
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):
| Condition | Kind |
|---|---|
nodeId | integer |
stalwart-cli wraps the same JMAP calls. See the CLI reference for installation, authentication, and general usage.
stalwart-cli get Metric id1stalwart-cli query Metricstalwart-cli query Metric --where nodeId=1