Skip to main content

A Riemann client and command line tool

Project description

https://pypip.in/v/riemann-client/badge.png https://travis-ci.org/borntyping/python-riemann-client.png?branch=master

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.

Authors

riemann-client was written by Sam Clements, while working at DataSift.

https://0.gravatar.com/avatar/8dd5661684a7385fe723b7e7588e91ee?d=https%3A%2F%2Fidenticons.github.com%2Fe83ef7586374403a328e175927b98cac.png&r=x&s=40 https://1.gravatar.com/avatar/a3a6d949b43b6b880ffb3e277a65f49d?d=https%3A%2F%2Fidenticons.github.com%2F065affbc170e2511eeacb3bd0e975ec1.png&r=x&s=40

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

riemann-client-4.1.2.tar.gz (8.6 kB view details)

Uploaded Source

Built Distribution

riemann_client-4.1.2-py2-none-any.whl (12.1 kB view details)

Uploaded Python 2

File details

Details for the file riemann-client-4.1.2.tar.gz.

File metadata

File hashes

Hashes for riemann-client-4.1.2.tar.gz
Algorithm Hash digest
SHA256 1274e7ce2194444d2f5881cb7d9fe9a9638789c26764484db4d7a41742c24a4e
MD5 bc352825a55f9e277c26428cc9800dc3
BLAKE2b-256 f9a5fa6d0d21a8a73e5474812b8f2ae42849a5df21daf4eec3d97325615ffe5f

See more details on using hashes here.

File details

Details for the file riemann_client-4.1.2-py2-none-any.whl.

File metadata

File hashes

Hashes for riemann_client-4.1.2-py2-none-any.whl
Algorithm Hash digest
SHA256 60d7cdf52fb1d2d733850311fff3e8605349e0e6212f8afb1bb3c5e3f5419438
MD5 9e268724cbbca315f91ce64837fc7a58
BLAKE2b-256 7a93122e6ccf3c5c6fbe560db2baadf221aac9781f665005f8f119ac03510558

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page