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


Release history Release notifications | RSS feed

This version

1.4.0

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.4.0.tar.gz (33.4 kB view hashes)

Uploaded Source

Built Distribution

epsagon-1.4.0-py3-none-any.whl (54.0 kB view hashes)

Uploaded Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page