Module katja_reader

The katja_reader module is responsible for querying Riemann.

Copyright © ?? Daniel Kempkens

Version: Apr 13 2020 14:27:19

Behaviours: gen_server.

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

Description

The katja_reader module is responsible for querying Riemann.
Riemann currently does not provide real documentation on how to write queries, but there are a couple of resources that can help you get started with writing them:

Function Index

query/2Sends a query string to Riemann and returns a list of matching events.
query_async/2Sends a query string to Riemann and returns the result asynchronously by sending a message to the caller.
query_event/2Takes an event and transforms it into a query string.
query_event_async/2Takes an event and transforms it into a query string.
start_link/0Starts a reader server process.
start_link/1Starts a reader server process and registers it as katja_reader.
stop/1Stops a reader server process.

Function Details

query/2

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

Sends a query string to Riemann and returns a list of matching events.
Example queries can be found in the Riemann test suite.

query_async/2

query_async(Pid::katja:process(), Query::iolist()) -> reference()

Sends a query string to Riemann and returns the result asynchronously by sending a message to the caller.
See the query/2 documentation for more details.

query_event/2

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

Takes an event and transforms it into a query string. The generated query string is passed to query/2.
Querying attributes is currently not supported, because Riemann itself does not provide a way to query events based on attributes.

Converting Event to a query string happens inside the process calling this function.

query_event_async/2

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

Takes an event and transforms it into a query string. The generated query string is passed to query_async/2.
See the query_event/2 documentation for more details.

start_link/0

start_link() -> {ok, pid()} | ignore | {error, term()}

Starts a reader server process.

start_link/1

start_link(Args::register | [{atom(), term()}]) -> {ok, pid()} | ignore | {error, term()}

Starts a reader server process and registers it as katja_reader.

stop/1

stop(Pid::katja:process()) -> ok

Stops a reader server process.


Generated by EDoc