Skip to main content

Epsagon Instrumentation for Python

Project description

Epsagon Instrumentation for Python

Build Status Pyversions PypiVersions

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


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
epsagon-1.5.1-py3-none-any.whl (54.2 kB) Copy SHA256 hash SHA256 Wheel py3
epsagon-1.5.1.tar.gz (33.7 kB) Copy SHA256 hash SHA256 Source None

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 SignalFx SignalFx Supporter DigiCert DigiCert EV certificate StatusPage StatusPage Status page