{"repo":"osskit/monitor","free":true,"listed":false,"github":"https://github.com/osskit/monitor","clone":"git clone https://github.com/osskit/monitor.git","description":"Monitor your services declaratively","language":"TypeScript","stars":19,"topics":["monitoring","prometheus","logging","metrics","monitor"],"license":"MIT","category":"analytics","readme_excerpt":"Utilize a declarative API to wrap your functions to capture Prometheus metrics & logs for each function Install Usage Scoped Unscoped With monitor options With global options API createMonitor({ scope: string, options?: MonitorOptions }) scope Type: string The scope of the monitor's metrics Will be used as the Prometheus metric name Returns an instance of a function that calls monitor - (method: string, callable: () = T, options?: MonitorOptions ) monitor(method: string, callable: () = T, options?: MonitorOptions) method Type: string Will be used for the method label of the metric, or the metric name if no parent scope was declared setGlobalOptions({ options: MonitorGlobalOptions }) Set a number of options that will be used globally for all monitor invocations setGlobalContext(value: () = Record ) Invoke a function that returns a global context to use in all monitor invocation logs Parameters MonitorOptions Parameter Description :-----------------------------------: ----------------------------------------------------------------------------- context?: boolean add context that will be logged in all method's logs logResult?: boolean log the method's result logExecutionStart?: boolean log the start of the method's execution method.start parseResult?: (e: any) = any transform the method's result that will be returned parseError?: (e: any) = any if the method errored, transform the error that will be thrown errorLogLevel?: pino.Level if the method errored, which level should the ","default_branch":null,"files":null,"tree":[],"storefront":"/r/osskit","claimed":false,"request_supported":{"post":"https://gitbuyer.com/r/osskit/monitor/request-supported","requests":0},"note":"indexed from public GitHub; nothing is for sale on this page. Clone it from GitHub. Paid listings live at /search."}