Module katja

This is the main module of the Katja application: It provides the public API.

Copyright © ?? Daniel Kempkens

Version: Apr 13 2020 14:27:19

Authors: Daniel Kempkens (daniel@kempkens.io).

Description

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)

The 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 respectively
tags: A value of instance will automatically be converted to instance: VM_NAME

Data Types

entities()

entities() = [{events, [event()]} | {states, [state()]}]

event()

event() = [riemann_event_opts()]

process()

process() = pid() | katja_writer | katja_reader

riemann_attributes()

riemann_attributes() = {attributes, [{iolist(), iolist()}]}

riemann_description()

riemann_description() = {description, iolist()}

riemann_event_opts()

riemann_event_opts() = riemann_time() | riemann_state() | riemann_service() | riemann_host() | riemann_description() | riemann_tags() | riemann_ttl() | riemann_attributes() | riemann_metric()

riemann_host()

riemann_host() = {host, iolist() | node_name | vm_name}

riemann_metric()

riemann_metric() = {metric, number()}

riemann_once()

riemann_once() = {once, boolean()}

riemann_service()

riemann_service() = {service, iolist()}

riemann_state()

riemann_state() = {state, iolist()}

riemann_state_opts()

riemann_state_opts() = riemann_time() | riemann_state() | riemann_service() | riemann_host() | riemann_description() | riemann_tags() | riemann_ttl() | riemann_once()

riemann_tags()

riemann_tags() = {tags, [iolist() | atom()]}

riemann_time()

riemann_time() = {time, non_neg_integer() | riemann}

riemann_ttl()

riemann_ttl() = {ttl, float()}

sample_rate()

sample_rate() = float()

state()

state() = [riemann_state_opts()]

Function Index

query/1Delegates to query/2.
query/2Delegates to katja_reader:query/2.
query_async/1Delegates to query_async/2.
query_async/2Delegates to katja_reader:query_async/2.
query_event/1Delegates to query_event/2.
query_event/2Delegates to katja_reader:query_event/2.
query_event_async/1Delegates to query_event_async/2.
query_event_async/2Delegates to katja_reader:query_event_async/2.
send_entities/1Delegates to send_entities/2.
send_entities/2Delegates to send_entities/3.
send_entities/3Sends multiple entities (events and/or states) to Riemann.
send_entities_async/1Delegates to send_entities_async/2.
send_entities_async/2Delegates to send_entities_async/3.
send_entities_async/3Delegates to send_entities_async/4.
send_entities_async/4Sends multiple entities (events and/or states) to Riemann asynchronously.
send_event/1Delegates to send_event/2.
send_event/2Delegates to send_event/3.
send_event/3Sends a single event to Riemann.
send_event_async/1Delegates to send_event_async/2.
send_event_async/2Delegates to send_event_async/3.
send_event_async/3Delegates to send_event_async/4.
send_event_async/4Sends a single event to Riemann asynchronously.
send_events/1Delegates to send_events/2.
send_events/2Delegates to send_events/3.
send_events/3Sends multiple events to Riemann.
send_events_async/1Delegates to send_events_async/2.
send_events_async/2Delegates to send_events_async/3.
send_events_async/3Delegates to send_events_async/4.
send_events_async/4Sends multiple events to Riemann asynchronously.
send_state/1Delegates to send_state/2.
send_state/2Delegates to send_state/3.
send_state/3Sends a single state to Riemann.
send_state_async/1Delegates to send_state_async/2.
send_state_async/2Delegates to send_state_async/3.
send_state_async/3Delegates to send_state_async/4.
send_state_async/4Sends a single state to Riemann asynchronously.
send_states/1Delegates to send_states/2.
send_states/2Delegates to send_states/3.
send_states/3Sends multiple states to Riemann.
send_states_async/1Delegates to send_states_async/2.
send_states_async/2Delegates to send_states_async/3.
send_states_async/3Delegates to send_states_async/4.
send_states_async/4Sends multiple states to Riemann asynchronously.
start/0Starts the Katja application and all of its dependencies.
stop/0Stops the Katja application and all of its dependencies.

Function Details

query/1

query(Query::string()) -> {ok, [event()]} | {error, term()}

Delegates to query/2. Pid is set to katja_reader.

query/2

query(Pid::process(), Query::string()) -> {ok, [event()]} | {error, term()}

Delegates to katja_reader:query/2.

query_async/1

query_async(Query::string()) -> reference()

Delegates to query_async/2. Pid is set to katja_reader.

query_async/2

query_async(Pid::process(), Query::string()) -> reference()

Delegates to katja_reader:query_async/2.

query_event/1

query_event(Event::event()) -> {ok, [event()]} | {error, term()}

Delegates to query_event/2. Pid is set to katja_reader.

query_event/2

query_event(Pid::process(), Event::event()) -> {ok, [event()]} | {error, term()}

Delegates to katja_reader:query_event/2.

query_event_async/1

query_event_async(Event::event()) -> reference()

Delegates to query_event_async/2. Pid is set to katja_reader.

query_event_async/2

query_event_async(Pid::process(), Event::event()) -> reference()

Delegates to katja_reader:query_event_async/2.

send_entities/1

send_entities(Data::entities()) -> ok | {error, term()}

Delegates to send_entities/2. Pid is set to katja_writer.

send_entities/2

send_entities(Pid::process(), Data::entities()) -> ok | {error, term()}

Delegates to send_entities/3. Transport is set to config.

send_entities/3

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/1

send_entities_async(Data::entities()) -> ok

Delegates to send_entities_async/2. Pid is set to katja_writer.

send_entities_async/2

send_entities_async(Pid::process(), Data::entities()) -> ok

Delegates to send_entities_async/3. Transport is set to config.

send_entities_async/3

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/4

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/1

send_event(Data::event()) -> ok | {error, term()}

Delegates to send_event/2. Pid is set to katja_writer.

send_event/2

send_event(Pid::process(), Data::event()) -> ok | {error, term()}

Delegates to send_event/3. Transport is set to config.

send_event/3

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/1

send_event_async(Data::event()) -> ok

Delegates to send_event_async/2. Pid is set to katja_writer.

send_event_async/2

send_event_async(Pid::process(), Data::event()) -> ok

Delegates to send_event_async/3. Transport is set to config.

send_event_async/3

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/4

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/1

send_events(Data::[event()]) -> ok | {error, term()}

Delegates to send_events/2. Pid is set to katja_writer.

send_events/2

send_events(Pid::process(), Data::[event()]) -> ok | {error, term()}

Delegates to send_events/3. Transport is set to config.

send_events/3

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/1

send_events_async(Data::[event()]) -> ok

Delegates to send_events_async/2. Pid is set to katja_writer.

send_events_async/2

send_events_async(Pid::process(), Data::[event()]) -> ok

Delegates to send_events_async/3. Transport is set to config.

send_events_async/3

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/4

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/1

send_state(Data::state()) -> ok | {error, term()}

Delegates to send_state/2. Pid is set to katja_writer.

send_state/2

send_state(Pid::process(), Data::state()) -> ok | {error, term()}

Delegates to send_state/3. Transport is set to config.

send_state/3

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/1

send_state_async(Data::state()) -> ok

Delegates to send_state_async/2. Pid is set to katja_writer.

send_state_async/2

send_state_async(Pid::process(), Data::state()) -> ok

Delegates to send_state_async/3. Transport is set to config.

send_state_async/3

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/4

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/1

send_states(Data::[state()]) -> ok | {error, term()}

Delegates to send_states/2. Pid is set to katja_writer.

send_states/2

send_states(Pid::process(), Data::[state()]) -> ok | {error, term()}

Delegates to send_states/3. Transport is set to config.

send_states/3

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/1

send_states_async(Data::[state()]) -> ok

Delegates to send_states_async/2. Pid is set to katja_writer.

send_states_async/2

send_states_async(Pid::process(), Data::[state()]) -> ok

Delegates to send_states_async/3. Transport is set to config.

send_states_async/3

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/4

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/0

start() -> ok

Starts the Katja application and all of its dependencies. This is really only meant for usage inside the console.

stop/0

stop() -> ok

Stops the Katja application and all of its dependencies. This is really only meant for usage inside the console.


Generated by EDoc