├── .gitignore ├── .travis.yml ├── AUTHORS ├── CHANGELOG.rst ├── LICENSE ├── MANIFEST.in ├── Makefile ├── README.rst ├── TODO.org ├── ci ├── setup └── test ├── conftest.py ├── docs └── usage.rst ├── examples └── test1.py ├── pyprometheus ├── __init__.py ├── compat.py ├── const.py ├── contrib │ ├── __init__.py │ ├── graphite.py │ └── uwsgi_features.py ├── managers.py ├── metrics.py ├── registry.py ├── scripts │ └── __init__.py ├── storage.py ├── utils │ ├── __init__.py │ └── exposition.py └── values.py ├── setup.cfg ├── setup.py ├── tests ├── __init__.py ├── test_core.py ├── test_metrics.py ├── test_registry.py ├── test_storage.py └── test_uwsgi_collector.py ├── tests_requirements.txt ├── tools ├── Dockerfile ├── Makefile └── compose-config.yml └── tox.ini /.gitignore: -------------------------------------------------------------------------------- 1 | *.pyc 2 | *.pyo 3 | *.egg-info 4 | __pycache__/* 5 | .cache/* 6 | .eggs/* 7 | .tox/* 8 | dist/* 9 | build/* 10 | .coverage 11 | \#*\# 12 | *~ 13 | *.\#* 14 | .ropeproject/* 15 | .python-version -------------------------------------------------------------------------------- /.travis.yml: -------------------------------------------------------------------------------- 1 | language: python 2 | sudo: false 3 | 4 | 5 | install: 6 | - time ci/setup 7 | 8 | script: 9 | - time ci/test 10 | 11 | 12 | notifications: 13 | email: false 14 | 15 | 16 | matrix: 17 | include: 18 | - python: "2.7" 19 | env: UWSGI="2.0.14" 20 | 21 | # - python: "3.3" 22 | # env: UWSGI="2.0.14" 23 | 24 | # - python: "3.4" 25 | # env: UWSGI="2.0.14" 26 | 27 | # - python: "3.5" 28 | # env: UWSGI="2.0.14" 29 | 30 | # - python: "3.6" 31 | # env: UWSGI="2.0.14" 32 | -------------------------------------------------------------------------------- /AUTHORS: -------------------------------------------------------------------------------- 1 | pyprometheus is written and maintained by Alexandr Lispython and 2 | various contributors: 3 | 4 | Development Lead 5 | ~~~~~~~~~~~~~~~~ 6 | 7 | - Alex Lispython 8 | 9 | Patches and Suggestions 10 | ~~~~~~~~~~~~~~~~~~~~~~~ 11 | -------------------------------------------------------------------------------- /CHANGELOG.rst: -------------------------------------------------------------------------------- 1 | Version 0.0.9 2 | ------------- 3 | 4 | * [BUGFIX] Fixed metric samples caching 5 | 6 | 7 | Version 0.0.8 8 | ------------- 9 | 10 | * [BUGFIX] Fixed escaping for export formats 11 | 12 | Version 0.0.7 13 | ------------- 14 | 15 | * [BUGFIX] Fixed `UWSGIStorage` memory corruptions 16 | 17 | 18 | Version 0.0.6 19 | ------------- 20 | 21 | * [BUGFIX] Fixed `UWSGIFlushStorage` init 22 | 23 | Version 0.0.5 24 | ------------- 25 | 26 | * [FEATURE] Added `UWSGIFlushStorage` 27 | * [FEATURE] Added `UWSGIStorage` metrics 28 | 29 | Version 0.0.4 30 | ------------- 31 | 32 | * [BUGFIX] Fixed `UWSGICollector.collect`` to return unique metrics. 33 | * [BUGFIX] Fixed registry_to_text format. 34 | 35 | Version 0.0.2 36 | ------------- 37 | 38 | * Initial version 39 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | Copyright (c) 2017 by Alexandr Lispython and contributors. 2 | See AUTHORS for more details. 3 | 4 | Some rights reserved. 5 | 6 | Redistribution and use in source and binary forms of the software as well 7 | as documentation, with or without modification, are permitted provided 8 | that the following conditions are met: 9 | 10 | * Redistributions of source code must retain the above copyright 11 | notice, this list of conditions and the following disclaimer. 12 | 13 | * Redistributions in binary form must reproduce the above 14 | copyright notice, this list of conditions and the following 15 | disclaimer in the documentation and/or other materials provided 16 | with the distribution. 17 | 18 | * The names of the contributors may not be used to endorse or 19 | promote products derived from this software without specific 20 | prior written permission. 21 | 22 | THIS SOFTWARE AND DOCUMENTATION IS PROVIDED BY THE COPYRIGHT HOLDERS AND 23 | CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT 24 | NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 25 | A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER 26 | OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, 27 | EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, 28 | PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR 29 | PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF 30 | LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING 31 | NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 32 | SOFTWARE AND DOCUMENTATION, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH 33 | DAMAGE. -------------------------------------------------------------------------------- /MANIFEST.in: -------------------------------------------------------------------------------- 1 | include setup.py README.rst MANIFEST.in LICENSE *.txt 2 | recursive-include pyprometheus/ * 3 | graft tests 4 | global-exclude *~ 5 | global-exclude #*# -------------------------------------------------------------------------------- /Makefile: -------------------------------------------------------------------------------- 1 | ifdef CMD 2 | DOCKER_CMD=$(CMD) 3 | else 4 | DOCKER_CMD=/bin/bash 5 | endif 6 | 7 | DOCKER_RUN_COMMAND=docker-compose -f tools/compose-config.yml run dev_pyprometheus 8 | 9 | 10 | default: help 11 | 12 | include tools/Makefile 13 | 14 | 15 | version := $(shell sh -c "egrep -oe '__version__\s+=\s+(.*)' ./pyprometheus/__init__.py | sed 's/ //g' | sed \"s/'//g\" | sed 's/__version__=//g'") 16 | 17 | #version := $(shell sh -c "$(DOCKER_RUN_COMMAND) 'python setup.py --version'") 18 | clean-pyc: 19 | find . -name '*.pyc' -exec rm -f {} + 20 | find . -name '*.pyo' -exec rm -f {} + 21 | find . -name '*~' -exec rm -f {} + 22 | find . -name "__pycache__" -exec rm -rf {} + 23 | 24 | clean-dist: 25 | rm -rf dist/* 26 | rm -rf build/* 27 | 28 | help: 29 | @echo "Available commands:" 30 | @sed -n '/^[a-zA-Z0-9_.]*:/s/:.*//p'