Skip to main content

Monitor Falcon with Riemann

Project description

Owl

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.0.1.tar.gz (5.7 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.0.1-py2.py3-none-any.whl (8.0 kB view details)

Uploaded Python 2Python 3

File details

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

File metadata

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

File hashes

Hashes for Owl-0.0.1.tar.gz
Algorithm Hash digest
SHA256 be255f780f3d8cffceb0cbea874ee6caf5c89628cabb3720c84dc67fa8f29ebd
MD5 90802186f5d24ae8dfc49d1efec889e1
BLAKE2b-256 149ec7a9f1c81efa48324b32a62493306d6fb4fcd6ff7e092e10931cad2ed867

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for Owl-0.0.1-py2.py3-none-any.whl
Algorithm Hash digest
SHA256 17ed5b3907ef0b4e4bc6bd2c3e0752f305a94c3d6a87e4fbac3a3032e6501103
MD5 5a791108037cbec66391d09f66770ab6
BLAKE2b-256 caea86434a7db75a632f6819636dec2badbf2c4a29ef769b226ff0d0d9b5dea4

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