Clients on the MetricQ network are managed via an RPC protocol, where
messages are encoded in a JSON format.
A request consists of a JSON object with a property "function"
, identifying
the action to perform.
Arguments are passed by specifying properties on the request object.
Replies are arbitrary JSON objects.
If a request could not be processed successfully, the reply has a single
property "error"
containing an error message as a string.
RPCs are grouped into three categories and are tagged as such:
management
:
Management RPCs are sent to an exchange called metricq.management
, management
clients subscribe to messages on this queue.
Replies from management clients arrive on a dedicated management queue.broadcast
:
Broadcast RPCs are sent to an exchange called metric.broadcast
.
All clients will receive such an request simultaneously and are expected to reply.direct
:
Some RPCs are sent directly into a client's RPC queue, bypassing any exchange.Query the network for available metrics
Request information about available metrics
A string identifying the requested RPC function
Whether to return an array of metric names or an object mapping metric names to their metadata
If given, limit returned metrics to either historic (true
) or non-historic (false
) metrics. If omitted, no filter is applied.
Number of matched metrics to include in response. If omitted, all matching metrics are returned.
If given, limit returned metrics to either hidden (true
) or not hidden (false
) metrics. If omitted, this filter is not applied.
Additional properties are allowed.
A selector matching a set of metrics, either by regex or explicit listing
A regular expression matching a set of metric names
A list of metric names
Items:
Additional items are allowed.
A prefix matching the start of a metric name
A list of matching metrics, with optional metadata
A collection of metric names, with optional metadata attached
A list of metric names
Items:
Additional items are allowed.
A mapping of metric names to metadata objects
Additional properties must adhere to the following schema:
A metadata object
The unit symbol according to SI, such as "V"
for voltage or "s"
for time.
If necessary, the SI prefix is included, e.g. "kV"
, "ms"
, or "kiB/s"
. Dimensionless quantities such as counts use either an empty string (""
) or the appropriate symbol (e.g. "rad").
The rate in Sa/s
(samples per second) or Hz
at which new values of this metric are typically produced. In practice, a source does not necessarily need to produce values exactly at this rate, but the value given should be good estimate.
The temporal validity of a single measured value.
A scope of "last"
indicates that a measured value was valid up to now, "next"
that it is valid from now on. A scope of "point"
means that any measurement is only valid at exactly the moment it was taken.
The name of the measured quantity.
Ideally, this is the same as the last segment of the metric name.
A human-readable description of the measurement quantity
Additional properties are allowed.
Additional properties are allowed.
Retrieve the configuration object for a set of clients
Retrieve configuration objects for matching clients
A string identifying the requested RPC function
A selector matching clients by their token
A list of client tokens
Items:
Additional items are allowed.
A regular expression matching a set of client tokens
Additional properties are allowed.
A mapping of client names to their configuration objects
Additional properties must adhere to the following schema:
A client configuration object
Additional properties are allowed.
Register a new sink on the network
A string identifying the requested RPC function
Additional properties are allowed.
On success, this contains the information necessary to start consuming metrics from the network. Optionally, a configuration object for this sink is returned.
URL pointing to the AMQP broker where data queues are handled
A client configuration object
Additional properties are allowed.
Additional properties are allowed.
Request to receive data points for a set of metrics.
A string identifying the requested RPC function
A list of metrics to subscribe to.
Items:
Additional items are allowed.
The AMQP queue on which data points should arrive.
The number of seconds after which the data queue should expire if not connected to a sink. If omitted, a default value is set.
Whether to include metadata for each metric in the reponse.
If set to false
, the result is an array of metric names, if set to true
, an object mapping metric names to metadata objects is returned.
Additional properties are allowed.
After successful subscription, this contains the broker address and queue on which data points for the requested metrics arrive. The metrics in question are returned, optionally with their metadata attached.
URL pointing to the AMQP broker where data queues are handled
The AMQP queue at which data points for the subscribed metrics will arrive.
A collection of metric names, with optional metadata attached
A list of metric names
Items:
Additional items are allowed.
A mapping of metric names to metadata objects
Additional properties must adhere to the following schema:
A metadata object
The unit symbol according to SI, such as "V"
for voltage or "s"
for time.
If necessary, the SI prefix is included, e.g. "kV"
, "ms"
, or "kiB/s"
. Dimensionless quantities such as counts use either an empty string (""
) or the appropriate symbol (e.g. "rad").
The rate in Sa/s
(samples per second) or Hz
at which new values of this metric are typically produced. In practice, a source does not necessarily need to produce values exactly at this rate, but the value given should be good estimate.
The temporal validity of a single measured value.
A scope of "last"
indicates that a measured value was valid up to now, "next"
that it is valid from now on. A scope of "point"
means that any measurement is only valid at exactly the moment it was taken.
The name of the measured quantity.
Ideally, this is the same as the last segment of the metric name.
A human-readable description of the measurement quantity
Additional properties are allowed.
Additional properties are allowed.
Subscribe to receive data points for a set of metrics
Stop receiving data points for a set of metrics
The AMQP queue at which data points should no longer be sent.
A list of metric names
Items:
Additional items are allowed.
If true
, the manager sends a type="end"
message after unbinding the routing keys to indicate that no more message will arrive at this queue.
An acknowledgement of unsubscription
URL pointing to the AMQP broker where data queues are handled
The collection of metrics this client is no longer subscribed to
A list of metric names
Items:
Additional items are allowed.
A mapping of metric names to metadata objects
Additional properties must adhere to the following schema:
A metadata object
The unit symbol according to SI, such as "V"
for voltage or "s"
for time.
If necessary, the SI prefix is included, e.g. "kV"
, "ms"
, or "kiB/s"
. Dimensionless quantities such as counts use either an empty string (""
) or the appropriate symbol (e.g. "rad").
The rate in Sa/s
(samples per second) or Hz
at which new values of this metric are typically produced. In practice, a source does not necessarily need to produce values exactly at this rate, but the value given should be good estimate.
The temporal validity of a single measured value.
A scope of "last"
indicates that a measured value was valid up to now, "next"
that it is valid from now on. A scope of "point"
means that any measurement is only valid at exactly the moment it was taken.
The name of the measured quantity.
Ideally, this is the same as the last segment of the metric name.
A human-readable description of the measurement quantity
Additional properties are allowed.
Additional properties are allowed.
Release a data queue
A string identifying the requested RPC function
The data queue to be released
Additional properties are allowed.
Acknowledgement of successful release
Additional properties are allowed.
Register a source on the network
A string identifying the requested RPC function
Additional properties are allowed.
URL pointing to the AMQP broker where data queues are handled
Name of the exchange to which data points should be published
A client configuration object
Additional properties are allowed.
Additional properties are allowed.
Declare a list of metrics which this source provides
A string identifying the requested RPC function
A collection of metric names, with optional metadata attached
A list of metric names
Items:
Additional items are allowed.
A mapping of metric names to metadata objects
Additional properties must adhere to the following schema:
A metadata object
The unit symbol according to SI, such as "V"
for voltage or "s"
for time.
If necessary, the SI prefix is included, e.g. "kV"
, "ms"
, or "kiB/s"
. Dimensionless quantities such as counts use either an empty string (""
) or the appropriate symbol (e.g. "rad").
The rate in Sa/s
(samples per second) or Hz
at which new values of this metric are typically produced. In practice, a source does not necessarily need to produce values exactly at this rate, but the value given should be good estimate.
The temporal validity of a single measured value.
A scope of "last"
indicates that a measured value was valid up to now, "next"
that it is valid from now on. A scope of "point"
means that any measurement is only valid at exactly the moment it was taken.
The name of the measured quantity.
Ideally, this is the same as the last segment of the metric name.
A human-readable description of the measurement quantity
Additional properties are allowed.
Additional properties are allowed.
Acknowledgement that metrics have been declared successfully
Additional properties are allowed.
Register a transformer on the network
A string identifying the requested RPC function
Additional properties are allowed.
Name of the exchange to which data points should be published
A client configuration object
Additional properties are allowed.
Additional properties are allowed.
Declare a list of metrics which this transformer provides
A string identifying the requested RPC function
A collection of metric names, with optional metadata attached
A list of metric names
Items:
Additional items are allowed.
A mapping of metric names to metadata objects
Additional properties must adhere to the following schema:
A metadata object
The unit symbol according to SI, such as "V"
for voltage or "s"
for time.
If necessary, the SI prefix is included, e.g. "kV"
, "ms"
, or "kiB/s"
. Dimensionless quantities such as counts use either an empty string (""
) or the appropriate symbol (e.g. "rad").
The rate in Sa/s
(samples per second) or Hz
at which new values of this metric are typically produced. In practice, a source does not necessarily need to produce values exactly at this rate, but the value given should be good estimate.
The temporal validity of a single measured value.
A scope of "last"
indicates that a measured value was valid up to now, "next"
that it is valid from now on. A scope of "point"
means that any measurement is only valid at exactly the moment it was taken.
The name of the measured quantity.
Ideally, this is the same as the last segment of the metric name.
A human-readable description of the measurement quantity
Additional properties are allowed.
Additional properties are allowed.
Acknowledgement that metrics have been declared successfully
Additional properties are allowed.
Subscribe to receive data points for a set of metrics
A string identifying the requested RPC function
A list of metric names
Items:
Additional items are allowed.
Whether to include metadata for each metric in the reponse.
If set to false
, the result is an array of metric names, if set to true
, an object mapping metric names to metadata objects is returned.
Additional properties are allowed.
transformer.subscribe
response
URL pointing to the AMQP broker where data queues are handled
The AMQP queue at which data points for the subscribed metrics will arrive.
A collection of metric names, with optional metadata attached
A list of metric names
Items:
Additional items are allowed.
A mapping of metric names to metadata objects
Additional properties must adhere to the following schema:
A metadata object
The unit symbol according to SI, such as "V"
for voltage or "s"
for time.
If necessary, the SI prefix is included, e.g. "kV"
, "ms"
, or "kiB/s"
. Dimensionless quantities such as counts use either an empty string (""
) or the appropriate symbol (e.g. "rad").
The rate in Sa/s
(samples per second) or Hz
at which new values of this metric are typically produced. In practice, a source does not necessarily need to produce values exactly at this rate, but the value given should be good estimate.
The temporal validity of a single measured value.
A scope of "last"
indicates that a measured value was valid up to now, "next"
that it is valid from now on. A scope of "point"
means that any measurement is only valid at exactly the moment it was taken.
The name of the measured quantity.
Ideally, this is the same as the last segment of the metric name.
A human-readable description of the measurement quantity
Additional properties are allowed.
Additional properties are allowed.
Register a database on the network.
A string identifying the requested RPC function
Additional properties are allowed.
URL pointing to the AMQP broker where data queues are handled
Name of the exchange to which data points should be published
Metrics to be saved in the DB arrive on this queue
Requests for historic data arrive on this queue
A client configuration object
Additional properties are allowed.
Additional properties are allowed.
Request to receive data points for metrics to be saved in the DB.
A string identifying the requested RPC function
A list of metrics to save, possibly with custom names for history requests.
A list of metrics to save in the DB
Items:
Additional items are allowed.
A list of metrics to save, with custom names for history requests.
Queue bindings for the dataQueue
will use input
, while queue bindings for the historyQueue
will use name
.
Additional items are allowed.
Whether to include metadata for each metric in the reponse.
If set to false
, the result is an array of metric names, if set to true
, an object mapping metric names to metadata objects is returned.
Additional properties are allowed.
After successful subscription, this contains the broker address and queue on which data points for the requested metrics arrive. The metrics in question are returned, optionally with their metadata attached.
URL pointing to the AMQP broker where data queues are handled
The AMQP queue at which data points for the subscribed metrics will arrive.
A collection of metric names, with optional metadata attached
A list of metric names
Items:
Additional items are allowed.
A mapping of metric names to metadata objects
Additional properties must adhere to the following schema:
A metadata object
The unit symbol according to SI, such as "V"
for voltage or "s"
for time.
If necessary, the SI prefix is included, e.g. "kV"
, "ms"
, or "kiB/s"
. Dimensionless quantities such as counts use either an empty string (""
) or the appropriate symbol (e.g. "rad").
The rate in Sa/s
(samples per second) or Hz
at which new values of this metric are typically produced. In practice, a source does not necessarily need to produce values exactly at this rate, but the value given should be good estimate.
The temporal validity of a single measured value.
A scope of "last"
indicates that a measured value was valid up to now, "next"
that it is valid from now on. A scope of "point"
means that any measurement is only valid at exactly the moment it was taken.
The name of the measured quantity.
Ideally, this is the same as the last segment of the metric name.
A human-readable description of the measurement quantity
Additional properties are allowed.
Additional properties are allowed.
Register a history client on the network.
A string identifying the requested RPC function
Additional properties are allowed.
URL pointing to the AMQP broker where data queues are handled
Requests for historic data arrive on this queue
A client configuration object
Additional properties are allowed.
Additional properties are allowed.
A discovery request sent to all clients online
A string identifying the requested RPC function
Additional properties are allowed.
A discovery response including operational information of a client
Current time on this host
When this client was started and first connected to the network
Number of nanoseconds since startup of this client.
If missing, assume this is the difference between currentTime
and startingTime
.
The version of the MetricQ client library that this client uses to communicate with the network. This value is intended for human consumption and its format should not be relied opon. Nonetheless, a format of <library-name>/<version> is encouraged.
The version of the running Python interpreter, if the client uses the MetricQ Python bindings.
The hostname identifying the machine that this client runs on.
Provide an updated configuration object to a client
A string identifying the requested RPC function
Additional properties are allowed.
Configuration acknowledgement
Acknowledgement that configuration has been received successfully
Additional properties are allowed.