Skip to main content

it_status

This Python package can be used for reporting to the MSK IT Status Dashboard.

Installation

pip install it-status

Usage

Use the IT Status class to explicitly control which events you report to the dashboard and when.

from it-status.status import ITStatus

# Setup the ITStatus instance with the URL to the application API and your tenant schema name
status = ITStatus(os.getenv("IT_STATUS_API_URL"), os.getenv("IT_STATUS_TENANT_SCHEMA"))

# These are the different ways of reporting events to your job - the job key can be found on the Jobs page
job_key = "<unique_job_key_here>"
status.ping(job_key, message="Ping test is working!")
status.status(job_key, message="CPU Utilization", data=70)
status.start(job_key, message="Process is starting")
status.error(job_key, message="Error in processes", log="Some log message goes here")
status.done(job_key, message="Process is complete", data=100)
status.log(job_key, message="Logging", log={"info": "This is a test log"})

Another option, is to use the ITStatusStartDone, and ITStatusPing decorators. These will automatically report events to the status board for any function that is decorated with them. To report for your entire python script, just decorate your main() function. Note: you must set the const values for the api url, tenant shcema and job key.

The ITStatusStartDone decorator will report a START event at the start of your function, a DONE event (with time to complete) when your function completes and an ERROR if any unhandled execptions are thrown.

@ITStatusStartDone(IT_STATUS_API_URL, IT_STATUS_TENANT_SCHEMA, IT_STATUS_JOB_KEY) 
def main():
    print("Hello World!")

if __name__ == "__main__":
    main()

If you just want you function to ping the status board, use the ITStatusPing decorator. This sends one ping event after your function completes.

@ITStatusPing(IT_STATUS_API_URL, IT_STATUS_TENANT_SCHEMA, IT_STATUS_JOB_KEY) 
def main():
    print("Hello World!")

if __name__ == "__main__":
    main()

Release files for it-status 0.0.9

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for it-status 0.0.9
File Size Uploaded
it-status-0.0.9.tar.gz 4.6 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for it-status 0.0.9
File Interpreter ABI Platform
it_status-0.0.9-py3-none-any.whl Python 3 none any Details

Total release size: 9.5 kB

Release files / it-status-0.0.9.tar.gz

Download URL it-status-0.0.9.tar.gz
Size 4.6 kB
Tags Source
SHA-256 checksum
How to use checksums
1167086b0d0c24688e94f3d0b2aaa3c6e4a20194e0cea6998be92065b9b991d9
BLAKE2b-256 checksum
How to use checksums
3832bb3544f5d1a401413dabfa3a483b4a9d171df1d4e9fc0188392770e2786c
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.4.1 importlib_metadata/4.5.0 pkginfo/1.7.0 requests/2.24.0 requests-toolbelt/0.9.1 tqdm/4.61.1 CPython/3.8.7

Release files / it_status-0.0.9-py3-none-any.whl

Download URL it_status-0.0.9-py3-none-any.whl
Size 4.9 kB
Tags Python 3
SHA-256 checksum
How to use checksums
0263b1c188ec5c6776b5191a01b1a8358ba9f1eef3baddaaed214357fc2a572e
BLAKE2b-256 checksum
How to use checksums
d7a7d88c5abdd9b535391e76fc138890f77e7ce1194f1706801976ad1344a113
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.4.1 importlib_metadata/4.5.0 pkginfo/1.7.0 requests/2.24.0 requests-toolbelt/0.9.1 tqdm/4.61.1 CPython/3.8.7

Release history Release notifications | RSS feed

This release

0.0.9 This release

2 release files

0.0.8

2 release files

0.0.7

2 release files

0.0.6

2 release files

0.0.5

2 release files

0.0.4

2 release files

0.0.3

2 release files

0.0.2

2 release files

0.0.1

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page