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

File metadata

File hashes

Hashes for sentry_cronjob_monitoring_johanalmquist-0.0.3.tar.gz
Algorithm Hash digest
SHA256 82df95c752c1136e1f2c1b15fc8d2b6f330156145855fd148de868c0512709a9
MD5 7907b35359d6fbdc42b36334ff88ad63
BLAKE2b-256 f9acd090c90cca2933665c37dbe046089e8e2846017b7c93e276217cc6a19f2d

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for sentry_cronjob_monitoring_johanalmquist-0.0.3-py3-none-any.whl
Algorithm Hash digest
SHA256 5a386ca3871e05dd91d4155692f6351738635ef2aaa5eb10d76d92e7b55557a2
MD5 6507e69e1c55f7f90cd4cf2800017dd1
BLAKE2b-256 32ac57b272a8315c3971434ce4c366693ecca77e98b7cf21dfc654b7a1e0d86e

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