semvec/pypi-packages huggingface dataset:
Camper-Logger-Exception 0.2.0
Python logging and exception catcher library for lazy peoples

# Camper-Logger-Exception  
**Simple, pretty and powerful logger and exception Catcher for python**  

This library has been developed to make it easier to detect errors in the application,   
and to make the process easier.  
  Also , More regular display of logs used in the application, allows saving to local file

## **Install** 
*(For use 3.4+)*

    pip install Camper-Logger-Exception


##### Using Logger
	from Camper.Log import CamperLogger
	logger = CamperLogger(logger_name=__name__, debug=True, record=True, log_path="/usr/log")


**logger_name :** Logger name for application or class - Required 

**debug :** Debug Mode True or False (default False) - Optional

 **log_path :**  The path of the saved log file (default project folder ) - Optional

**record :** If it is called True, it saves the records to the file. (default False ) - Optional

 ##### Usage : 


    logger.error(message="test")
    logger.warning(message="test")
    logger.info(message="test")


 ##### Using Exception Catcher
	from Camper.ExceptionCatcher import CamperException
	@CamperException.exception_catcher(default=5,record=True)  
	def example(value):
		#do something here


**default :**  if If the function receives an error, the value to return. (default None) - Optional  

**default_callback :** Sends the default value to the specified function. - Optional 

 **error_callback :**  Sends the error message to the specified function. - Optional  

**log_path :** The path of the saved log file (default project folder ) - Optional

**record :** If it is called True, it saves the records to the file. - Optional

**post_endpoint :** If post_endpoint is added, it will post the message text to the url. (Post Payload {"error":" Error message"}) - Optional

**extra_data :** Extra data added to post_endpoint (key extra) - Optional

 ###### Contribute:
Send me more features if you want it

We need your Help to become it to better.

 ###### EDIT:
 07-16-2019 : Add Sentry Capture Exception Feature
 for using - CamperException(sentry_dns="http://xxxxx.sentry.io/xxxxx") 

###### Contact:

>abdullahkulcu@outlook.com
prom-url-checker 0.0.4
Prom-url-checker, a url checker with prometheus metrics output
Requires Python: >=3.6
Keywords: http domain url monitoring prometheus check

# prometheus-url-checker

This little script periodically checks all configured urls with a HTTP HEAD request. The requests http code will be returned as prometheus compatible metric (gauge).

## Links

* [official docs](https://prom-url-checker.readthedocs.io)

## Install

The packages uses the `flit` packager and requires `python 3.6`.

* `pip3 install flit`
* `flit install`

## Usage

The application is very simple to configure. Simply set the `URLS` environment variable and start the server with `prom-url-checker`. You can see the metrics opening `http://127.0.0.1:9999/metrics`. To integrate this into your prometheus environment, simply add a new prometheus endpoint.

A very simple cli allows the configuration of all necessary parameters.

* `prom-url-checker` starts the metrics server on `127.0.0.1:9999` using the `URLS` environmental variable
* `prom-url-checker --help` show's available cli options:

```bash
Options:
--host=STR            Host ip to serve on. (default: 127.0.0.1)
--port=STR            Port to use (default: 9999)
-s, --sleeptime=INT   Sleeptime during checks (default: 5)
--urls=STR            Comma seperated list of urls to check, e.g. --urls https://test.domain.de,http://domain.de.  If unset, the environment variable URLS will be used instead.
-d, --debug           Enable debugging mode

Other actions:
-h, --help            Show the help
```

## Metrics

```
# HELP request_in_progress Number of requests in progress
# TYPE request_in_progress gauge
request_in_progress{app="url_health_checker",host="f8cad31124a6",route="/"} 0

# HELP url_health Health status of a url.
# TYPE url_health gauge
url_health{app="url_health_checker",host="f8cad31124a6",url="https://google.com"} 301
url_health{app="url_health_checker",host="f8cad31124a6",url="https://github.com"} 200

# HELP url_health_request_processing_seconds Time spent processing request
# TYPE url_health_request_processing_seconds summary
url_health_request_processing_seconds{app="url_health_checker",host="f8cad31124a6",quantile="0.5"} 0.17756042900145985
url_health_request_processing_seconds{app="url_health_checker",host="f8cad31124a6",quantile="0.9"} 0.2960943900034181
url_health_request_processing_seconds{app="url_health_checker",host="f8cad31124a6",quantile="0.99"} 0.2960943900034181
url_health_request_processing_seconds_count{app="url_health_checker",host="f8cad31124a6"} 14
url_health_request_processing_seconds_sum{app="url_health_checker",host="f8cad31124a6"} 3.8046043350186665
```