Utilities for integration between serverless execution environments and DataDog
Project description
DataDog Serverless Utils
Utilities for integration between serverless execution environments and DataDog
Error Tracking for Serverless Execution Environments
Serverless execution environments (e.g. Cloud Functions) are finished by the cloud provider as soon as the execution finished. Sometimes, the DataDog tracer (ddtrace) does not have a chance to send the collected traces especially when it ends abruptly due to an unhandled exception.
This library offers a decorator to make sure ddtrace can send the telemetry data before the execution ends.
Setup
Make sure ddtrace config is correctly set up as mentioned on the docs.
Usage
Decorate your function as follows and voilà!
from datadog_serverless_utils import datadog_serverless
@datadog_serverless
def main():
...
A return value can be specified for the case when the decorated function raises an unhandled exception via the parameter error_return_value
:
@datadog_serverless(error_return_value="my_value")
def main():
...
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
File details
Details for the file datadog-serverless-utils-1.0.7.tar.gz
.
File metadata
- Download URL: datadog-serverless-utils-1.0.7.tar.gz
- Upload date:
- Size: 3.2 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.9.13
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 85d87c20e19d0addbed0663162311e8edd6f293e59369b330895b10ace4a4190 |
|
MD5 | 4a6a74c4e85eeaa2adbd1ccab303b783 |
|
BLAKE2b-256 | e632893c53b38289ccc2a5c8555c32a1e328cf8c77dc7c06dab002f851f06872 |