tensor.outputs

tensor.outputs.riemann

class tensor.outputs.riemann.RiemannTCP(*a)[source]

Bases: tensor.objects.Output

Riemann TCP output

Configuration arguments:

Parameters:
  • server (str.) – Riemann server hostname (default: localhost)
  • port (int.) – Riemann server port (default: 5555)
  • failover (bool.) – Enable server failover, in which case server may be a list
  • maxrate (int.) – Maximum de-queue rate (0 is no limit)
  • maxsize (int.) – Maximum queue size (0 is no limit, default is 250000)
  • interval (float.) – De-queue interval in seconds (default: 1.0)
  • pressure (int.) – Maximum backpressure (-1 is no limit)
  • tls (bool.) – Use TLS (default false)
  • cert (str.) – Host certificate path
  • key (str.) – Host private key path
  • allow_nan (bool) – Send events with None metric value (default true)
createClient()[source]

Create a TCP connection to Riemann with automatic reconnection

emptyQueue()[source]

Remove all or self.queueDepth events from the queue

eventsReceived(events)[source]

Receives a list of events and transmits them to Riemann

Arguments: events – list of tensor.objects.Event

stop()[source]

Stop this client.

tick()[source]

Clock tick called every self.inter

class tensor.outputs.riemann.RiemannUDP(*a)[source]

Bases: tensor.objects.Output

Riemann UDP output (spray-and-pray mode)

Configuration arguments:

Parameters:
  • server (str.) – Riemann server IP address (default: 127.0.0.1)
  • port (int.) – Riemann server port (default: 5555)
createClient()[source]

Create a UDP connection to Riemann

eventsReceived(events)[source]

Receives a list of events and transmits them to Riemann

Arguments: events – list of tensor.objects.Event

tensor.outputs.elasticsearch

class tensor.outputs.elasticsearch.ElasticSearchLog(*a)[source]

Bases: tensor.objects.Output

ElasticSearch HTTP API output

This Output transposes events to a Logstash format

Configuration arguments:

Parameters:
  • url (str) – Elasticsearch URL (default: http://localhost:9200)
  • maxsize (int) – Maximum queue backlog size (default: 250000, 0 disables)
  • maxrate (int) – Maximum rate of documents added to index (default: 100)
  • interval (int) – Queue check interval in seconds (default: 1.0)
  • user (str) – Optional basic auth username
  • password (str) – Optional basic auth password
createClient()[source]

Sets up HTTP connector and starts queue timer

eventsReceived(events)[source]

Receives a list of events and queues them

Arguments: events – list of tensor.objects.Event

stop()[source]

Stop this client.

tick(*args, **kwargs)[source]

Clock tick called every self.inter