Skip to main content

This package can be used to the MSK IT Status Dashboard

Project description

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()

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

it-status-0.0.9.tar.gz (4.6 kB view details)

Uploaded Source

Built Distribution

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

it_status-0.0.9-py3-none-any.whl (4.9 kB view details)

Uploaded Python 3

File details

Details for the file it-status-0.0.9.tar.gz.

File metadata

  • Download URL: it-status-0.0.9.tar.gz
  • Upload date:
  • Size: 4.6 kB
  • Tags: Source
  • Uploaded using 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

File hashes

Hashes for it-status-0.0.9.tar.gz
Algorithm Hash digest
SHA256 1167086b0d0c24688e94f3d0b2aaa3c6e4a20194e0cea6998be92065b9b991d9
MD5 f1aede5a99a9aa338792a67b4f4c22ba
BLAKE2b-256 3832bb3544f5d1a401413dabfa3a483b4a9d171df1d4e9fc0188392770e2786c

See more details on using hashes here.

File details

Details for the file it_status-0.0.9-py3-none-any.whl.

File metadata

  • Download URL: it_status-0.0.9-py3-none-any.whl
  • Upload date:
  • Size: 4.9 kB
  • Tags: Python 3
  • Uploaded using 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

File hashes

Hashes for it_status-0.0.9-py3-none-any.whl
Algorithm Hash digest
SHA256 0263b1c188ec5c6776b5191a01b1a8358ba9f1eef3baddaaed214357fc2a572e
MD5 e77c467cad26990ff050def10726d11f
BLAKE2b-256 d7a7d88c5abdd9b535391e76fc138890f77e7ce1194f1706801976ad1344a113

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