Skip to main content

Falcon to Telegraf middlewares

Project description




Build Status

What is this?

Package to ease gathering metrics from Falcon APIs into InfluxDB via a Telegraf. By use of middlewares this orthogonal functionality is added in a hassle-free way minimizing required work. Sane defaults make quickstart really quick 👍


Inject the middleware (or couple of them) when creating Api instance:

telegraf_client = TelegrafClient('localhost', 8094)
app = falcon.API(

Note that passing telegraf_client is totally optional. Measurement names can be set when creating middleware, prefixed or autogenerated.



Creates a metric named hits-path/to/endpoint with one fields called hits with value 1.


Similar to LogHits but executes after on-* method was called and adds more context data. Because of this you can add custom tags. Example:

def on_get(self, request, response, some_path_variable):
    request.context['my_new_tag'] = 'this_tags_value'
    request.context['some_path_variable'] = some_path_variable  ## this is unnecessary - it's logged by middleware

It's metric name is the same as for LogHits. Note that using this two middlewares in the sam API doesn't make any sense.


Reports time in ms elapsed between registering response and registering request. Default metric prefix is time-. Other things in processing pipeline can affect it's readings so take them with a grain of salt.


First bump version in in master branch via merge request. Afterwards push a version tag and wait.

git tag `date +"%Y.%-m.%-d.1"`
git push --tags

Project details

Download files

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

Filename, size & hash SHA256 hash help File type Python version Upload date
falcon-telegraf-middleware-2018.7.12.1.tar.gz (5.9 kB) Copy SHA256 hash SHA256 Source None Jul 12, 2018

Supported by

Elastic Elastic Search Pingdom Pingdom Monitoring Google Google BigQuery Sentry Sentry Error logging AWS AWS Cloud computing DataDog DataDog Monitoring Fastly Fastly CDN DigiCert DigiCert EV certificate StatusPage StatusPage Status page