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

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

File details

Details for the file sentry_cronjob_monitoring_johanalmquist-0.0.1.tar.gz.

File metadata

File hashes

Hashes for sentry_cronjob_monitoring_johanalmquist-0.0.1.tar.gz
Algorithm Hash digest
SHA256 0182290cd34b584187d335d93d24340963af0ff465f43c935ad302ce100d4cfd
MD5 a598ed867c5d194c09a13cd1325811f6
BLAKE2b-256 5c6149f3afdc98dc46e906455a61273217f674338e59a2a1e5aaf66a426a3845

See more details on using hashes here.

File details

Details for the file sentry_cronjob_monitoring_johanalmquist-0.0.1-py3-none-any.whl.

File metadata

File hashes

Hashes for sentry_cronjob_monitoring_johanalmquist-0.0.1-py3-none-any.whl
Algorithm Hash digest
SHA256 b19689ff7c486681ea2d36af5180608565ef0826e80d854102d6f52a1b22e334
MD5 c9dd6685a4f7b973e6a00010b8afa24d
BLAKE2b-256 a51af13a523df2799131fae2efac4c562518fb1930b3e675999584639a790ded

See more details on using hashes here.

Supported by

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