Copyright © ?? Daniel Kempkens
Version: Apr 13 2020 14:27:19
Authors: Daniel Kempkens (daniel@kempkens.io).
This is the main module of the Katja application: It provides the public API.
While it is possible to use katja_writer
and katja_reader
directly, the recommended way is to use the functions defined
in this module instead.
Configuration:
host
: Host Riemann is running on
port
: Port Riemann is listening on
transport
: The message transport that should be used (supported: detect
, udp
, tcp
)
pool
: List of processes that should not be started (and supervised) by Katja (supported: katja_reader
, katja_writer
)
defaults
: Property list with default values for events and states (supported: host
, tags
, ttl
)
defaults
property list supports some special values for certain keys.host
: A value of node_name
or vm_name
will automatically set it to the value of node()
or the name of the VM respectivelytags
: A value of instance
will automatically be converted to instance: VM_NAME
entities() = [{events, [event()]} | {states, [state()]}]
event() = [riemann_event_opts()]
process() = pid() | katja_writer | katja_reader
riemann_attributes() = {attributes, [{iolist(), iolist()}]}
riemann_description() = {description, iolist()}
riemann_event_opts() = riemann_time() | riemann_state() | riemann_service() | riemann_host() | riemann_description() | riemann_tags() | riemann_ttl() | riemann_attributes() | riemann_metric()
riemann_host() = {host, iolist() | node_name | vm_name}
riemann_metric() = {metric, number()}
riemann_once() = {once, boolean()}
riemann_service() = {service, iolist()}
riemann_state() = {state, iolist()}
riemann_state_opts() = riemann_time() | riemann_state() | riemann_service() | riemann_host() | riemann_description() | riemann_tags() | riemann_ttl() | riemann_once()
riemann_tags() = {tags, [iolist() | atom()]}
riemann_time() = {time, non_neg_integer() | riemann}
riemann_ttl() = {ttl, float()}
sample_rate() = float()
state() = [riemann_state_opts()]
query(Query::string()) -> {ok, [event()]} | {error, term()}
Delegates to query/2
. Pid
is set to katja_reader
.
Delegates to katja_reader:query/2
.
query_async(Query::string()) -> reference()
Delegates to query_async/2
. Pid
is set to katja_reader
.
query_async(Pid::process(), Query::string()) -> reference()
Delegates to katja_reader:query_async/2
.
Delegates to query_event/2
. Pid
is set to katja_reader
.
Delegates to katja_reader:query_event/2
.
query_event_async(Event::event()) -> reference()
Delegates to query_event_async/2
. Pid
is set to katja_reader
.
Delegates to katja_reader:query_event_async/2
.
send_entities(Data::entities()) -> ok | {error, term()}
Delegates to send_entities/2
. Pid
is set to katja_writer
.
send_entities(Pid::process(), Data::entities()) -> ok | {error, term()}
Delegates to send_entities/3
. Transport
is set to config
.
send_entities(Pid::process(), Transport::katja_connection:transport(), Data::entities()) -> ok | {error, term()}
Sends multiple entities (events and/or states) to Riemann. Delegates to katja_writer:send_entities/3
.
send_entities_async(Data::entities()) -> ok
Delegates to send_entities_async/2
. Pid
is set to katja_writer
.
send_entities_async(Pid::process(), Data::entities()) -> ok
Delegates to send_entities_async/3
. Transport
is set to config
.
send_entities_async(Pid::process(), Transport::katja_connection:transport(), Data::entities()) -> ok
Delegates to send_entities_async/4
. SampleRate
is set to 1.0
.
send_entities_async(Pid::process(), Transport::katja_connection:transport(), Data::entities(), SampleRate::sample_rate()) -> ok
Sends multiple entities (events and/or states) to Riemann asynchronously. Delegates to katja_writer:send_entities_async/4
.
send_event(Data::event()) -> ok | {error, term()}
Delegates to send_event/2
. Pid
is set to katja_writer
.
Delegates to send_event/3
. Transport
is set to config
.
send_event(Pid::process(), Transport::katja_connection:transport(), Data::event()) -> ok | {error, term()}
Sends a single event to Riemann. Delegates to katja_writer:send_event/3
.
send_event_async(Data::event()) -> ok
Delegates to send_event_async/2
. Pid
is set to katja_writer
.
Delegates to send_event_async/3
. Transport
is set to config
.
send_event_async(Pid::process(), Transport::katja_connection:transport(), Data::event()) -> ok
Delegates to send_event_async/4
. SampleRate
is set to 1.0
.
send_event_async(Pid::process(), Transport::katja_connection:transport(), Data::event(), SampleRate::sample_rate()) -> ok
Sends a single event to Riemann asynchronously. Delegates to katja_writer:send_event_async/4
.
send_events(Data::[event()]) -> ok | {error, term()}
Delegates to send_events/2
. Pid
is set to katja_writer
.
Delegates to send_events/3
. Transport
is set to config
.
send_events(Pid::process(), Transport::katja_connection:transport(), Data::[event()]) -> ok | {error, term()}
Sends multiple events to Riemann. Simple wrapper around send_entities/3
.
send_events_async(Data::[event()]) -> ok
Delegates to send_events_async/2
. Pid
is set to katja_writer
.
Delegates to send_events_async/3
. Transport
is set to config
.
send_events_async(Pid::process(), Transport::katja_connection:transport(), Data::[event()]) -> ok
Delegates to send_events_async/4
. SampleRate
is set to 1.0
.
send_events_async(Pid::process(), Transport::katja_connection:transport(), Data::[event()], SampleRate::sample_rate()) -> ok
Sends multiple events to Riemann asynchronously. Simple wrapper around send_entities_async/4
.
send_state(Data::state()) -> ok | {error, term()}
Delegates to send_state/2
. Pid
is set to katja_writer
.
Delegates to send_state/3
. Transport
is set to config
.
send_state(Pid::process(), Transport::katja_connection:transport(), Data::state()) -> ok | {error, term()}
Sends a single state to Riemann. Delegates to katja_writer:send_state/3
.
send_state_async(Data::state()) -> ok
Delegates to send_state_async/2
. Pid
is set to katja_writer
.
Delegates to send_state_async/3
. Transport
is set to config
.
send_state_async(Pid::process(), Transport::katja_connection:transport(), Data::state()) -> ok
Delegates to send_state_async/4
. SampleRate
is set to 1.0
.
send_state_async(Pid::process(), Transport::katja_connection:transport(), Data::state(), SampleRate::sample_rate()) -> ok
Sends a single state to Riemann asynchronously. Delegates to katja_writer:send_state_async/4
.
send_states(Data::[state()]) -> ok | {error, term()}
Delegates to send_states/2
. Pid
is set to katja_writer
.
Delegates to send_states/3
. Transport
is set to config
.
send_states(Pid::process(), Transport::katja_connection:transport(), Data::[state()]) -> ok | {error, term()}
Sends multiple states to Riemann. Simple wrapper around send_entities/3
.
send_states_async(Data::[state()]) -> ok
Delegates to send_states_async/2
. Pid
is set to katja_writer
.
Delegates to send_states_async/3
. Transport
is set to config
.
send_states_async(Pid::process(), Transport::katja_connection:transport(), Data::[state()]) -> ok
Delegates to send_states_async/4
. SampleRate
is set to 1.0
.
send_states_async(Pid::process(), Transport::katja_connection:transport(), Data::[state()], SampleRate::sample_rate()) -> ok
Sends multiple states to Riemann asynchronously. Simple wrapper around send_entities_async/4
.
start() -> ok
Starts the Katja application and all of its dependencies. This is really only meant for usage inside the console.
stop() -> ok
Stops the Katja application and all of its dependencies. This is really only meant for usage inside the console.
Generated by EDoc