Skip to main content

Monitor Falcon with Riemann

Project description

Owl

https://api.travis-ci.org/merry-bits/Owl.svg?branch=master

Measure how long your Falcon requests take and send each measurement as an event to Riemann.

Example

Owl is designed to be a mix-in class for API. To use Owl you create your own API class providing configuration parameters for Owl.

In Python 3 this could look something like this:

from falcon.api import API
from riemann_client.client import QueuedClient
from owl import Owl

class MonitoredAPI(Owl, API):

    def __init__(self, *args, **kwds):
        kwds["get_riemann_client"] = lambda: QueuedClient()
        kwds["owl_service"] = "MyAPI"  # service name for Riemann
        super().__init__(*args, **kwds)

api = MonitoredAPI()
# api.add_route(...)
# ...

In Riemann you get the end point and the request result status code as tags. To convert them into their own InfluxDB tags ( endpoint` and ``status-code) for later use (for example in Grafana) you could do something like this in your Riemann InfluxDB configuration:

(defn- parse-api-event
 [event]
 (if (contains? event :tags)
   (let [[endpoint status-code & other] (:tags event)]
     (assoc event
       :endpoint endpoint
       :status-code status-code))
   event))

(let [index (index)]
 (streams index
   ; Write API monitoring to database
   (where (service "MyAPI")
     #(info (parse-api-event %))
     (comp api-db parse-api-event))))

Check out the event_builder parameter if you want to customize the event parameters (change what service means or add a description for example).

Installation

$ pip install owl

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

Owl-0.1.0.tar.gz (5.8 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

Owl-0.1.0-py2.py3-none-any.whl (8.1 kB view details)

Uploaded Python 2Python 3

File details

Details for the file Owl-0.1.0.tar.gz.

File metadata

  • Download URL: Owl-0.1.0.tar.gz
  • Upload date:
  • Size: 5.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No

File hashes

Hashes for Owl-0.1.0.tar.gz
Algorithm Hash digest
SHA256 eedb26a2e9d6e83d0ce8bc887ed263346db1d705073c3e24843a3c57b072e052
MD5 e7dd24df82b4289311e2a5701a33b9fe
BLAKE2b-256 c87014a10288703550746a8181a86d44ff488edaef4a159577a5d493897ecd14

See more details on using hashes here.

File details

Details for the file Owl-0.1.0-py2.py3-none-any.whl.

File metadata

File hashes

Hashes for Owl-0.1.0-py2.py3-none-any.whl
Algorithm Hash digest
SHA256 f519e3bc977e430fbd0fa9e7e529420ac804ec3108c9d84d82339b22284bd88d
MD5 296bb1e40c02ea0d3adb95373caca8f4
BLAKE2b-256 6210110f2e2f9c2b8e41f01eb009e6be34a89e64ae67f73ecec1b7524679447d

See more details on using hashes here.

Supported by

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