Skip to main content

A package for use Sentrys Cronjob Monitor Module

Project description

sentry_cronjob_monitoring

A small package with a class and a decorator to integrate with Sentrys Cron Monitoring

Example usage

By class

from sentry_cronjob_monitoring import Monitor
import typer

monitor = Monitor(
    dsn="https://examplePublicKey@o0.ingest.sentry.io/0",
    monitor_id="monitor-id-123",
    org_slug="example-org",
)
def main(times: str):
    monitor.checkin()
    sleep_times = times.split(",")
    sleep_time = int(random.choice(sleep_times))
    logger.info(f"will sleep for {sleep_time} seconds")
    sleep(sleep_time)
    logger.info("Done with my sleep")
    monitor.checkout()

if __name__ == "__main__":
    typer.run(main)

By decorator

from sentry_cronjob_monitoring import with_monitoring

@with_monitoring(
    dsn="https://examplePublicKey@o0.ingest.sentry.io/0",
    monitor_id="monitor-id-123",
    org_slug="example-org",
)
def run():
    logger.info("will sleep for 10 seconds")
    sleep(10)
    logger.info("Done with my sleep")

if __name__ == "__main__":
    run()

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

sentry_cronjob_monitoring-0.0.3.tar.gz (3.3 kB view details)

Uploaded Source

Built Distribution

File details

Details for the file sentry_cronjob_monitoring-0.0.3.tar.gz.

File metadata

File hashes

Hashes for sentry_cronjob_monitoring-0.0.3.tar.gz
Algorithm Hash digest
SHA256 cd07c3000ac3174e319b2843343ba64a7a3790b5b49659945e539485f7023f49
MD5 fd966984b062e2a0bf10b050c6057181
BLAKE2b-256 562b858ad7525935302528da72ae6f2dedd8c14acd20d313306a6b34454e9d1b

See more details on using hashes here.

File details

Details for the file sentry_cronjob_monitoring-0.0.3-py3-none-any.whl.

File metadata

File hashes

Hashes for sentry_cronjob_monitoring-0.0.3-py3-none-any.whl
Algorithm Hash digest
SHA256 4debd8ca0c35367b35a8891f2f3d00a40b05c82061839a06244a0a02bce2193e
MD5 19d6357425355417e8cd736883aba130
BLAKE2b-256 bcdb10de4c34998c99eedf9616cca1030a24578bf8e60579c12dad0a481582ed

See more details on using hashes here.

Supported by

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