Sink
- class metricq.Sink(*args, add_uuid=True, **kwargs)
A base class intended to be subclassed to create user-defined Sinks.
See Building a MetricQ Sink for an introduction how to implement a Sink.
- Parameters:
- abstractmethod await on_data(metric, timestamp, value)
A Callback that is invoked for every data point received for any of the metrics this client is subscribed to.
User-defined Sinks need to override this method to handle incoming data points.
- await subscribe(metrics, expires=None, metadata=None, **kwargs)
Subscribe to a list of metrics.
- Parameters:
- Return type:
- Returns:
rpc response
- class metricq.DurableSink(*args, **kwargs)
A base class for user-defined Sinks that uses a configuration. General
Sink
implementations are transient and therefore do not register as unique agents with a configuration. This implementation does call the sink.register RPC and receives a configuration in response that is passed to the config rpc handler.See
Sink
for the general API.Constructor arguments are passed to
Sink
. However,add_uuid
is not supported and alwaysFalse
.