Skip to main content

errormator_client

LEGACY MODE

Python Logo Pyramid Logo Flask Logo Django Logo

Installation and Setup

Install errormator_client using pip:

pip install errormator-client

Main Documentation location

Errormator developer documentation contains most up to date information, including implementation guides in popular python web frameworks.

https://errormator.com

Documentation: https://errormator.com/page/api/main

Usage

Before you can use the client inside your application you first need to navigate to the directory that stores your application configuration and issue following command:

$ENV/bin/python/errormator_client makeini errormator.ini

Usage (example for pyramid or other WSGI pipeline compatible solutions like Zope):

In your INI file you need to add:

[filter:errormator_client]
use = egg:errormator_client
errormator.config_path = %(here)s/errormator.ini #optional if you don't want to set ERRORMATOR_INI env var

[pipeline:main]
pipeline =
    .....your other pipeline entries ....
    errormator_client
    app_name

To minimize configuration complexity, the client by default will look for ERRORMATOR_INI environment variable that will supply absolute path to config file.

for pylons app you can modify config/middleware.py: import the callable and add this lines:

#exception gathering
# CUSTOM MIDDLEWARE HERE (filtered by error handling middlewares)

app = make_errormator_middleware(app,config)

and add in your ini:

errormator.config_path = %(here)s/errormator.ini #optional if you don't want to set ERRORMATOR_INI env var

Errormator client provides slow call and datastore timing capabilities, currently out of the box folliwing libraries are supported:

  • urllib

  • urllib2

  • urllib3

  • requests

  • pysolr

  • httplib

  • most used dbapi2 drivers

  • mongodb

  • mako templates

  • jinja2 templates

  • django templates

If for some reason you want to disable timing of specific library - just set the time value to false.

Configuring errormator and django

For django framework there is separate compatible middleware provided.

Modify your settings file to contain:

import errormator_client.client as e_client
ERRORMATOR = e_client.get_config()

Additionally middleware stack needs to be modified with additional middleware:

MIDDLEWARE_CLASSES = (
    'errormator_client.django_middleware.ErrormatorMiddleware',
    'django.middleware.common.CommonMiddleware',
    ...

Please note that errormator middleware should be the first one in stack to function properly.

Run your django app providing ERRORMATOR_INI env variable containing absolute path to your config file.

Changing default scaffold configuration in Pyramid Web Framework

Default scaffolds in pyramid 1.3 have a section called [app:main] - errormator client expects that you are using wsgi pipeline instead to position itself in it.

The easiest way to accomplish that is to alter your configuration file to look like this:

[app:main] becomes [app:yourappname]

and inside your configuration, above [server:main] directive following directive should appear:

[pipeline:main]
pipeline =
    ... your other middleware you may have ...
    errormator_client
    yourappname

Exception views in Pyramid Web Framework and Errormator

You also need to add errormator tween to your application, you can do this in two ways:

# by adding following line to your config object
config.include('errormator_client.ext.pyramid_tween')

Or by altering your ini file to contain a new include:

pyramid.includes = errormator_client.ext.pyramid_tween
                   ... other includes you might have ..

Sensitive data filtering

The client by default blanks out COOKIE,POST,GET for keys like: ‘password’,’passwd’,’pwd’,’auth_tkt’

This behaviour can be altered to filter all kinds of data from the structures that get sent to the server by passing dotted module name in configuration:

errormator.filter_callable = foo.bar.baz:callable_name

example:

def callable_name(structure, section=None):
    structure['request']['SOMEVAL'] = '***REMOVED***'
    return structure

Errormator will try to import foo.bar.baz and use callable_name as the function that accepts parameters (structure, section) and returns altered data structure.

Please note that this functionality can be used to alter things like errormator grouping mechanism - you can set this variable based on values present in structure generated by the client

errormator_client is BSD licensed, consult LICENSE for details.

client source: https://github.com/AppEnlight/errormator-client-python

Release files for errormator-client 0.5.15

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for errormator-client 0.5.15
File Size Uploaded
errormator_client-0.5.15.tar.gz 36.3 kB Details

Release files / errormator_client-0.5.15.tar.gz

Download URL errormator_client-0.5.15.tar.gz
Size 36.3 kB
Tags Source
SHA-256 checksum
How to use checksums
4bd2209f0ecfb9d3bc37bd0195f5873b564e60e5021bf1f634e115ce9ad300b0
BLAKE2b-256 checksum
How to use checksums
0c199f2c39b2081140de6912a097abca5226e0c09237858944c98fa5fbee91be
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No

Release history Release notifications | RSS feed

This release

0.5.15 This release

1 release file

0.5.14

1 release file

0.5.13

1 release file

0.5.12

1 release file

0.5.11

1 release file

0.5.10

1 release file

0.5.9

1 release file

0.5.8

1 release file

0.5.7

1 release file

0.5.6

1 release file

0.5.5

1 release file

0.5.1

1 release file

0.5

1 release file

0.4.1

1 release file

0.4

1 release file

0.3.14

1 release file

0.3.13

1 release file

0.3.12

1 release file

0.3.11

1 release file

0.3.10

1 release file

0.3.8

1 release file

0.3.7

1 release file

0.3.6

1 release file

0.3.1

0.2

1 release file

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page