څ. v d dl mZ d dlZd dlmZ d dlmZ d dlmZ d dl m
Z
d dlmZ er
d dl
mZmZmZ d
d ZdS ) wrapsN)reraise)
TYPE_CHECKING)capture_checkin)
MonitorStatus)now)AnyCallableOptionalc fd}|S )a
Decorator to capture checkin events for a monitor.
Usage:
```
import sentry_sdk
app = Celery()
@app.task
@sentry_sdk.monitor(monitor_slug='my-fancy-slug')
def test(arg):
print(arg)
```
This does not have to be used with Celery, but if you do use it with celery,
put the `@sentry_sdk.monitor` decorator below Celery's `@app.task` decorator.
c H s S t fd }|S )Nc ~ t }t t j } | i |}nZ# t $ rM t |z
}t |t j | t
j }t | Y nw xY wt |z
}t |t j | |S )N)monitor_slugstatus)r check_in_idr duration)
r r r IN_PROGRESS ExceptionERRORsysexc_infor OK) argskwargsstart_timestampr result
duration_sr funcr s l/builddir/build/BUILD/cloudlinux-venv-1.0.10/venv/lib/python3.11/site-packages/sentry_sdk/crons/decorator.pywrapperz*monitor.