Auditor
Last updated
Last updated
A Python package that provides standardized logging and error handling for the Anuvaad dataflow pipeline. This package serves features like session tracing, job tracing, error debugging, and troubleshooting.
Prerequisites:
Python 3.7
Source code:
Command:
This part of the library provides features for logging by exposing the following functions:
Import file:
Logs INFO level information.
Logs DEBUG level information.
Logs ERROR level information. Should be used for logical errors like “File is not valid”, “File format not accepted” etc.
Logs EXCEPTION level information. Should be used in case of exceptions like “TypeError”, “KeyError” etc.
In all the functions, message and input-object are mandatory.
These functions build an object using these parameters and index them to Elasticsearch for easy tracing.
Ensure all major functions have a log_info
call, all exceptions have log_exception
calls, and all logical errors have log_error
calls.
This part of the library provides features for standardizing and indexing the error objects of the pipeline.
Import file:
Returns a standard error object for replying back to the client during a SYNC call and indexes the error to an error index.
Constructs a standard error object which will be indexed to a different error index and PUSHES THE ERROR TO WFM internally.
Usage Notes:
Use post_error_wf
for flows triggered via Kafka or REST through WFM.
Ensure both log functions and error functions are used in case of exceptions or errors.
Errors are indexed to two different indexes: Error index and Audit Index.
Use post_error_wf
carefully, as this method will take the entire job to FAILED state.
anuvaad-auditor==0.1.1
- Please use this version.