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. However, it does not currently support event attributes or a SSL TCP transport.
The client library aims to provide a simple, minimal API does not require direct interaction with protocol buffers (though it does allow using the protobuf API directly, allowing you to use unsupported features such as event attributes). There is also a queued client that can queue events and then send 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=1) client.event(service='two', metric_f=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](https://github.com/jordansissel/fpm).
Requirements
Changelog
Version numbers use the semver specification. A new major version indicates breaking changes.
Version 3.1.x
Relaxed version requirements to fit CentOS 6 packages
~~Added Makefile and specfile for building RPMs with rpmbuild~~
Added Makefile to build RPMs with fpm
Version 3.0.0
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 Distributions
Built Distribution
File details
Details for the file riemann-client-4.1.0.tar.gz
.
File metadata
- Download URL: riemann-client-4.1.0.tar.gz
- Upload date:
- Size: 8.6 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 29c8c8ed04c2bb82a480a455476110da5b6601147d5aa7206df1fad0d8146b47 |
|
MD5 | b450447e70345bcce1ca32525f377889 |
|
BLAKE2b-256 | 350c2ecde6fb48e88d141a9238e416d984205675b550827d07506b58ff7b384b |
File details
Details for the file riemann-client-4.1.0.linux-x86_64.tar.gz
.
File metadata
- Download URL: riemann-client-4.1.0.linux-x86_64.tar.gz
- Upload date:
- Size: 14.3 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 1195fbb0b8d4f222a35a7968779ee91f9089c0de8aafc4f9a73f4500cb4556a5 |
|
MD5 | c495020f25b5b777463b6414f1621957 |
|
BLAKE2b-256 | ef1084d0b48144038c69381bacd9fc8961a5f1a352f76002da83be21403086cf |
File details
Details for the file riemann_client-4.1.0-py2-none-any.whl
.
File metadata
- Download URL: riemann_client-4.1.0-py2-none-any.whl
- Upload date:
- Size: 12.0 kB
- Tags: Python 2
- Uploaded using Trusted Publishing? No
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | a2294fda026fa79c256331581485f512a9f92767fc3b6f3e5b22143c09df3d76 |
|
MD5 | 3e3739913d73a027b703be19dfdcb5f8 |
|
BLAKE2b-256 | 980341793dd212198c4f6e12d85d494d6ec08dd7f58fedfafb071eb2cecce932 |