Skip to main content

Command-line utility for interfacing with OpsDuty.

Project description

opsduty-python

Command-line utility for interfacing with OpsDuty.

Heartbeats

Send periodic heartbeats to OpsDuty using opsduty-python. The heartbeat needs to be configured in OpsDuty before check-ins can be observed. Head over to https://opsduty.io to configure your heartbeats.

Alternative 1: Decorator

from opsduty_python.heartbeats.heartbeats import (
    heartbeat_checkin,
)

@heartbeat_checkin(heartbeat="HBXXXX", environment="prod", enabled=True)
def periodic_job():
    pass

Alternative 2: Send heartbeat manually.

from opsduty_python.heartbeats.heartbeats import (
    send_heartbeat_checkin,
)

def periodic_job():
    try:
        pass
    except Exception:
        print("Job failed.")
    else:
        send_heartbeat_checkin(heartbeat="HBXXXX", environment="prod")

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

opsduty_python-0.2.0.tar.gz (13.9 kB view hashes)

Uploaded Source

Built Distribution

opsduty_python-0.2.0-py3-none-any.whl (19.1 kB view hashes)

Uploaded Python 3

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