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.2.tar.gz.

File metadata

File hashes

Hashes for sentry_cronjob_monitoring_johanalmquist-0.0.2.tar.gz
Algorithm Hash digest
SHA256 08178302abad79c327debdcd752e69948fa0b57a150ef6fdc3dadf4f32a8b44f
MD5 437ea3e58f6713b4b8ae82ab24fd3c14
BLAKE2b-256 683aac6e3d69c2508e590cc76eb5912f02c0c3fde788cd9a9bb6ea4ab1d75b56

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for sentry_cronjob_monitoring_johanalmquist-0.0.2-py3-none-any.whl
Algorithm Hash digest
SHA256 4eb60414714c498238950b7fd9f0b6e632776ed6488e9e0dcacf6904d0ea4873
MD5 7521ba54d9df25ae619bbc18effca121
BLAKE2b-256 d585a9ceb2425be17ce4eb778e397a567f26cca9dec3d51150155708476ab910

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