Netflix-Skunkworks / raven-python-lambda

Sentry/Raven SDK Integration For AWS Lambda (python) and Serverless
Apache License 2.0
47 stars 15 forks source link

User specified memory usage and timeout warning thresholds #32

Closed aspotton closed 6 years ago

aspotton commented 6 years ago

Added two config options to allow for configuring the thresholds to trigger the timeout and memory usage events. The default values fallback to the current hard-coded ones if these options aren't specified.

config options: timeout_warning_threshold (environment variable: SENTRY_TIMEOUT_THRESHOLD) memory_warning_threshold (environment variable: SENTRY_MEMORY_THRESHOLD)

These are float values that represent the percentage for the threshold trigger.

For example: To have a timeout warning at 30 seconds on a function with a max runtime of 60 seconds, set timeout_warning_threshold = 0.50

coveralls commented 6 years ago

Coverage Status

Coverage decreased (-0.2%) to 89.057% when pulling 0cb202c564464ab9b14f3a8f5a875289519e499a on aspotton:set_warning_thresholds into f06e664368ac25dd53411239cc9513dc60634837 on Netflix-Skunkworks:master.