A Riemann client and command line tool
Project description
A Riemann client library and command line tool for Python. It supports UDP and TCP transports, queries, and all metric types. The client library aims to provide a simple, minimal API does not require direct interaction with protocol buffers. There is also a queued client that can queue or batch events and then send them in a single message.
Usage
As a command line tool:
riemann-client [--host HOST] [--port PORT] send [-s SERVICE] [-S STATE] [-m METRIC] [...] riemann-client [--host HOST] [--port PORT] query QUERY
The host and port used by the command line tool can also be set with the RIEMANN_HOST and RIEMANN_PORT environment variables. By default, localhost:5555 will be used.
As a library:
import riemann_client.client with riemann_client.client.Client() as client: client.event(service="riemann-client", state="awesome") client.query("service = 'riemann-client'")
A more detailed example, using both a non-default transport and a queued client:
from riemann_client.transport import TCPTransport from riemann_client.client import QueuedClient with QueuedClient(TCPTransport("localhost", 5555)) as client: client.event(service="one", metric_f=0.1) client.event(service="two", metric_f=0.2) client.flush()
The QueuedClient class modifies the event() method to add events to a queue instead of immediately sending them, and adds the flush() method to send the current event queue as a single message.
Installation
riemann-client requires Python 2.6 or 2.7, and can be installed with pip install riemann-client. Python 3 is not supported due to the dependency on the Google protobuf package. You can also use the provided makefile to build and distribute an RPM using fpm.
Requirements
Changelog
Version 5.x.x
Added API documentation (riemann-client.readthedocs.org)
Replaced argparse with click for an improved CLI
Various command line parameters changed
--event-host became --host
--print was removed, send always prints the sent event
Minor fixes to QueuedClient API
UDPTransport.send returns None instead of NotImplemented
Version 4.2.x
Added events() and send_events() methods to the client
Added clear_queue() method to the queued client
Add --timeout option for TCP based transports
Version 4.1.x
Full Riemann protocol support (TLS transport, event attributes)
Fixes for multiple broken features (--tags, --print)
Raise errors when clients are used incorrectly
Client displays errors from Riemann nicely
Relaxed version requirements to fit CentOS 6 packages
Version 3.0.x
Renamed module from riemann to riemann_client
Command line interface was rewritten, and is now the only part of the library that respects the RIEMANN_HOST and RIEMANN_PORT environment variables
Support for querying the Riemann index was added
Internally, transports now define send instead of write, and TCPTransport.send returns Riemann’s response message
Licence
riemann-client is licensed under the MIT Licence. The protocol buffer definition is sourced from the Riemann Java client, which is licensed under the Apache Licence.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
File details
Details for the file riemann-client-5.0.0.tar.gz
.
File metadata
- Download URL: riemann-client-5.0.0.tar.gz
- Upload date:
- Size: 10.6 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 7f73958c0f39cd8602a94b096f8c6eede825982951df25bb67e86ca4bf9e43cf |
|
MD5 | cde32abb80777d698e8606f5cf621658 |
|
BLAKE2b-256 | 4cc0bd8067f7607f7eec95669e40c32ab8585a63934d808664e25c931d8b4f50 |
File details
Details for the file riemann_client-5.0.0-py2-none-any.whl
.
File metadata
- Download URL: riemann_client-5.0.0-py2-none-any.whl
- Upload date:
- Size: 14.5 kB
- Tags: Python 2
- Uploaded using Trusted Publishing? No
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 2016f40c6109c003a334a4b520778542364a6a02cfe078e245f00e3f11c7fb1d |
|
MD5 | 30477b7d79593e5c1645d86f926aec24 |
|
BLAKE2b-256 | a06c81becbb7a707454f85cc03498ddd4b49f0ac75da24503455370381f45218 |