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.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.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.4.tar.gz (3.3 kB view details)

Uploaded Source

Built Distribution

File details

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

File metadata

File hashes

Hashes for sentry_cronjob_monitoring-0.0.4.tar.gz
Algorithm Hash digest
SHA256 b43e31f80b44ac23c28c6172bed7260933a7135f6f1a5fcdd93f3e924a18d622
MD5 9cbb73383b9c2c60cda2de2b201165b9
BLAKE2b-256 5b9b277079246ee7f992aa8203b345511c30df087cd1e8284221deae557b6be9

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for sentry_cronjob_monitoring-0.0.4-py3-none-any.whl
Algorithm Hash digest
SHA256 2ba58143c7a77cca32a7bdede604d08066ebf1bf07ff7e152464a63fa5686d68
MD5 14803011cee30aed286dd6139f134248
BLAKE2b-256 ac252cda5d07a906d58117dc9f8a7ea8c36ffe9d3674c9e61a0ccbaeae71e60f

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