EdgePulse Python SDK for edge functions monitoring and observability
Project description
EdgePulse Python SDK
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
-
Set up your environment:
export EDGEPULSE_PROJECT_KEY="your-api-key-here" export EDGEPULSE_API_URL="https://api.edgepulse.com/api/Invocation" # Optional
-
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 keyEDGEPULSE_API_URL(optional): EdgePulse API endpoint (defaults to https://edgepulse.jeremytrips.be)EDGEPULSE_DEBUG(optional): Set to1,true, orTrueto mark invocations as debug (suppresses error notifications)EDGEPULSE_CAPTURE_ARGS(optional): Set to1,true, orTrueto 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
- Documentation: Does not exists yet
- Issues: https://github.com/jeremytrips/edgepulse.py/issues
- Email: jeremy.trips@gmail.com
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
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
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
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
97d339525a1a4fcae57ba1916a56d0baffcf57c5301352a30ad294729739ad75
|
|
| MD5 |
b7363dd263d679e85c8b94c33d903b5d
|
|
| BLAKE2b-256 |
0555e607269b37e1a4b9136824a26554f2a9ccfa206e8c58891c908c4f1ac7b3
|
Provenance
The following attestation bundles were made for edgepulse-0.1.4.tar.gz:
Publisher:
publish-python-sdk.yml on jeremytrips/Edgepulse.py
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
edgepulse-0.1.4.tar.gz -
Subject digest:
97d339525a1a4fcae57ba1916a56d0baffcf57c5301352a30ad294729739ad75 - Sigstore transparency entry: 1437332287
- Sigstore integration time:
-
Permalink:
jeremytrips/Edgepulse.py@4c22fead64fbba133288192026f74a25be7aff32 -
Branch / Tag:
refs/heads/main - Owner: https://github.com/jeremytrips
-
Access:
private
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish-python-sdk.yml@4c22fead64fbba133288192026f74a25be7aff32 -
Trigger Event:
workflow_dispatch
-
Statement type:
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
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
d4cfa67baf13357bc090407543a788c3d3adb96938ed61c10778c5cf763f5e1a
|
|
| MD5 |
4f2c8e7c556a2b529b2c2691c396b347
|
|
| BLAKE2b-256 |
3dc981dd67e107ce0476269497c7ea0f8e3e75386357450984f8ecbf8d96d9e6
|
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
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
edgepulse-0.1.4-py3-none-any.whl -
Subject digest:
d4cfa67baf13357bc090407543a788c3d3adb96938ed61c10778c5cf763f5e1a - Sigstore transparency entry: 1437332304
- Sigstore integration time:
-
Permalink:
jeremytrips/Edgepulse.py@4c22fead64fbba133288192026f74a25be7aff32 -
Branch / Tag:
refs/heads/main - Owner: https://github.com/jeremytrips
-
Access:
private
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish-python-sdk.yml@4c22fead64fbba133288192026f74a25be7aff32 -
Trigger Event:
workflow_dispatch
-
Statement type: