Skip to main content

EdgePulse Python SDK for edge functions monitoring and observability

Project description

EdgePulse Python SDK

PyPI version Python Support License: MIT

The EdgePulse Python SDK provides monitoring and observability capabilities for Python applications. It allows you to track function executions, capture timing data, handle errors, and send telemetry to EdgePulse services.

Installation

Install the EdgePulse SDK using pip:

pip install edgepulse

Quick Start

  1. Set up your environment:

    export EDGEPULSE_PROJECT_KEY="your-api-key-here"
    export EDGEPULSE_API_URL="https://api.edgepulse.com/api/Invocation"  # Optional
    
  2. Use the decorator to monitor functions:

    from Edgepulse import with_edgepulse
    
    @with_edgepulse
    def my_function(x, y):
        """Your function logic here."""
        return x + y
    
    # The function will now be monitored automatically
    result = my_function(1, 2)
    

Features

  • Zero-configuration monitoring: Simple decorator-based approach
  • Automatic timing: Captures function execution duration
  • Error tracking: Records exceptions with full stack traces
  • Flexible telemetry: Sends data to configurable EdgePulse endpoints
  • Type safety: Full type hints for better development experience
  • No external dependencies: Uses only Python standard library

Configuration

The SDK uses environment variables for configuration:

  • EDGEPULSE_PROJECT_KEY (required): Your EdgePulse API key
  • EDGEPULSE_API_URL (optional): EdgePulse API endpoint (defaults to https://edgepulse.jeremytrips.be)
  • EDGEPULSE_DEBUG (optional): Set to 1, true, or True to mark invocations as debug (suppresses error notifications)
  • EDGEPULSE_CAPTURE_ARGS (optional): Set to 1, true, or True to capture function arguments in error events (default: False)

Advanced Usage

Capturing Function Arguments

By default, function arguments are not captured for privacy reasons. To enable argument capture in error events:

from Edgepulse import configure

# Enable globally
configure(api_key="your-key", capture_args=True)

@with_edgepulse
def process_payment(amount, card_number):
    # If an error occurs, arguments will be captured
    # Sensitive parameters like 'card_number' containing 'password', 'token',
    # 'secret', 'api_key', or 'auth' are automatically redacted
    pass

Or using environment variables:

export EDGEPULSE_CAPTURE_ARGS=true

Security & Privacy:

  • Arguments are only captured when errors occur (not for successful invocations)
  • Sensitive parameter names are automatically redacted (password, token, secret, api_key, auth patterns)
  • Argument data is size-limited to 10KB (truncated if larger)
  • Non-serializable objects are replaced with [Non-serializable: TypeName] placeholders

Per-Function Configuration

from Edgepulse import with_edgepulse, EdgePulseConfig

# Configure per function
@with_edgepulse(cfg=EdgePulseConfig(
    api_key="your-key",
    capture_args=True
))
def critical_function(data):
    # This function will capture arguments on errors
    pass

Custom HTTP client

from Edgepulse import WebClient, store_invocation

# Use a custom client with different timeout
client = WebClient("https://api.edgepulse.com/api/Invocation", timeout=30)
store_invocation(invocation, client=client)

Development

Setting up development environment

git clone https://github.com/edgepulse/sdk-python.git
cd sdk-python
pip install -e ".[dev]"

Requirements

  • Python 3.9+

License

This project is licensed under the MIT License - see the LICENSE file for details.

Support

Contributing

We welcome contributions!

Project details


Download files

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

Source Distribution

edgepulse-0.1.4.tar.gz (13.4 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

edgepulse-0.1.4-py3-none-any.whl (9.2 kB view details)

Uploaded Python 3

File details

Details for the file edgepulse-0.1.4.tar.gz.

File metadata

  • Download URL: edgepulse-0.1.4.tar.gz
  • Upload date:
  • Size: 13.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for edgepulse-0.1.4.tar.gz
Algorithm Hash digest
SHA256 97d339525a1a4fcae57ba1916a56d0baffcf57c5301352a30ad294729739ad75
MD5 b7363dd263d679e85c8b94c33d903b5d
BLAKE2b-256 0555e607269b37e1a4b9136824a26554f2a9ccfa206e8c58891c908c4f1ac7b3

See more details on using hashes here.

Provenance

The following attestation bundles were made for edgepulse-0.1.4.tar.gz:

Publisher: publish-python-sdk.yml on jeremytrips/Edgepulse.py

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file edgepulse-0.1.4-py3-none-any.whl.

File metadata

  • Download URL: edgepulse-0.1.4-py3-none-any.whl
  • Upload date:
  • Size: 9.2 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for edgepulse-0.1.4-py3-none-any.whl
Algorithm Hash digest
SHA256 d4cfa67baf13357bc090407543a788c3d3adb96938ed61c10778c5cf763f5e1a
MD5 4f2c8e7c556a2b529b2c2691c396b347
BLAKE2b-256 3dc981dd67e107ce0476269497c7ea0f8e3e75386357450984f8ecbf8d96d9e6

See more details on using hashes here.

Provenance

The following attestation bundles were made for edgepulse-0.1.4-py3-none-any.whl:

Publisher: publish-python-sdk.yml on jeremytrips/Edgepulse.py

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

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