Epsagon Instrumentation for Python
Project description
Epsagon Instrumentation for Python
This package provides an instrumentation to Python code running on functions for collection of distributed tracing and performance monitoring.
Installation
From your project directory:
$ pip install epsagon
More details about lambda deployments are available in the AWS documentation.
Basic Usage
Simply use our decorator to report metrics:
import epsagon
epsagon.init(
token='my-secret-token',
app_name='my-app-name',
metadata_only=False, # Optional, send more trace data
)
@epsagon.lambda_wrapper
def handler(event, context):
pass
Custom labels
You can add custom labels to your traces. Filters can later be used for filtering traces that contains specific labels:
@epsagon.lambda_wrapper
def handler(event, context):
epsagon.label('label', 'something_to_filter_afterwards')
epsagon.label('number_of_records_parsed_successfully', 42)
pass
Set Error
Set a custom error, maybe without even failing the function:
@epsagon.lambda_wrapper
def handler(event, context):
if 'my_param' not in event:
epsagon.error(ValueError('event missing my_param'))
pass
Copyright
Provided under the MIT license. See LICENSE for details.
Copyright 2019, Epsagon.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
epsagon-1.6.0.tar.gz
(33.9 kB
view hashes)
Built Distribution
epsagon-1.6.0-py3-none-any.whl
(54.6 kB
view hashes)