Skip to content

buzzni/bbm

Folders and files

NameName
Last commit message
Last commit date

Latest commit

ย 

History

44 Commits
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 

Repository files navigation

bbm

๐Ÿ“Š Buzzni Batch process Monitor -> BBM

Package version Supported Python versions

Installation

pip install bbm

Example

logging

from bbm import Interval, logging, setup


@logging()
def temp_func():
    return "Hello World"


@logging(process_name="custom_name_of_process", interval=Interval.A_DAY)
def temp_func2():
    return "Hello World"


if __name__ == "__main__":
    setup(es_url="your-es-url", index_prefix="your-index-prefix")
    temp_func()
    temp_func2()

post report

from bbm import reporter, setup

if __name__ == "__main__":
    # init bbm
    setup(es_url="your-es-url", index_prefix="your-index-prefix")
    
    # init reporter and send simple messages
    reporter = reporter.Reporter(slack_token="your-slack-token", slack_channel_id="your-slack-channel-id")
    post_response = reporter.post_message(title="title", text="text")
    ts = post_response["ts"]
    post_message_to_thread = reporter.post_message(title="title", text="text", ts=ts)
    
    # send report    
    reporter.post_report()

Report sample

  1. Need to check report report_sample
  2. Full report (It will be sent as a file at 'need to check report' thread) report_sample