{"id":39630942,"url":"https://github.com/codeaffen/p3exporter","last_synced_at":"2026-01-18T08:44:21.430Z","repository":{"id":49165864,"uuid":"342225958","full_name":"codeaffen/p3exporter","owner":"codeaffen","description":"Quickstart your Prometheus exporter development based on Python.","archived":false,"fork":false,"pushed_at":"2024-10-07T17:44:36.000Z","size":255,"stargazers_count":10,"open_issues_count":1,"forks_count":3,"subscribers_count":4,"default_branch":"develop","last_synced_at":"2025-09-24T07:52:37.606Z","etag":null,"topics":["docker","hacktoberfest","prometheus","prometheus-exporter","python","quickstart"],"latest_commit_sha":null,"homepage":"https://codeaffen.org/projects/p3exporter","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/codeaffen.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":"CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2021-02-25T11:43:45.000Z","updated_at":"2024-10-07T17:44:39.000Z","dependencies_parsed_at":"2023-01-18T06:15:32.504Z","dependency_job_id":null,"html_url":"https://github.com/codeaffen/p3exporter","commit_stats":null,"previous_names":[],"tags_count":6,"template":false,"template_full_name":null,"purl":"pkg:github/codeaffen/p3exporter","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/codeaffen%2Fp3exporter","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/codeaffen%2Fp3exporter/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/codeaffen%2Fp3exporter/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/codeaffen%2Fp3exporter/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/codeaffen","download_url":"https://codeload.github.com/codeaffen/p3exporter/tar.gz/refs/heads/develop","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/codeaffen%2Fp3exporter/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28534148,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-18T00:39:45.795Z","status":"online","status_checked_at":"2026-01-18T02:00:07.578Z","response_time":98,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["docker","hacktoberfest","prometheus","prometheus-exporter","python","quickstart"],"created_at":"2026-01-18T08:44:21.322Z","updated_at":"2026-01-18T08:44:21.417Z","avatar_url":"https://github.com/codeaffen.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Python programmable Prometheus exporter\n\n[![Docker Repository on Quay](https://quay.io/repository/codeaffen/p3exporter/status \"Docker Repository on Quay\")](https://quay.io/repository/codeaffen/p3exporter)\n[![PyPI version](https://badge.fury.io/py/p3exporter.svg)](https://badge.fury.io/py/p3exporter)\n[![Codacy Badge](https://app.codacy.com/project/badge/Grade/0c608f1a8a18412ba2031853b8963be7)](https://www.codacy.com/gh/codeaffen/p3exporter/dashboard?utm_source=github.com\u0026amp;utm_medium=referral\u0026amp;utm_content=codeaffen/p3exporter\u0026amp;utm_campaign=Badge_Grade)\n[![Documentation Status](https://readthedocs.org/projects/p3exporter/badge/?version=develop)](https://p3exporter.readthedocs.io/en/latest/?badge=latest)\n\np3exporter will help any DevOps to quickstart its Prometheus exporter development. It is completly written in python and provides a facility for pluggable metric collectors.\nThe exporter comes with real life exporters to illustrate how it works but is also intended to use as a framework for completely custom collectors.\n\nThe included collectors were only tested on linux systems. Other \\*nix derivates are not supported by us but you are welcome to contribute to bring this exporter to a broader audience.\n\n## Installation and Running\n\nThere are different ways to run the exporter on your system. Our exporter listen on tcp/5876 by default. You can change this by adding `--port` or `-p` option with the port of your choice.\n\n### Running exporter as docker container\n\nThe simplest way will is to start it as docker container.\nThe container image is hosted on [quay.io](https://quay.io/repository/codeaffen/p3exporter) and [dockerhub](https://hub.docker.com/r/codeaffen/p3exporter) and the `latest` tag represent the `develop` branch of the github repository.\nIf you want to use a given version you can us the verson string (e.g. `v1.0.0`) as tag instead.\n\n```text\ndocker run -d --net=\"host\" --pid=\"host\" -v \"/:/host:ro,rslave\" codeaffen/p3exporter:latest\n```\n\n### Installing from pypi.org\n\nWe also release all versions on [pypi](https://pypi.org/project/p3exporter/) so you can use `pip` to install the exporter and run it locally.\n\n```text\npip install p3exporter\n```\n\nThis will install the exporter and all of its dependencies. Now you can start it as every other program. You need to provide a valid configuration file either by adding `--config` or `-c` option with path to your `p3.yml` file or by defining an environment variable `P3E_CONFIG` which points to your configuration.\n\n```text\n$ curl --silent https://raw.githubusercontent.com/codeaffen/p3exporter/develop/p3.yml --output ~/tmp/p3.yml\n$ p3exporter --config ~/tmp/p3.yml\nINFO:root:Collector 'example' was loaded and registred successfully\nINFO:root:Collector 'loadavg' was loaded and registred successfully\nINFO:root:Collector 'netdev' was loaded and registred successfully\nINFO:root:Start exporter, listen on 5876\n```\n\n### Install from repository\n\nThe last option to install and run p3exporter is to install it from a local clone of our [github repository](https://github.com/codeaffen/p3exporter).\n\n```text\n$ git clone https://github.com/codeaffen/p3exporter.git\nCloning into 'p3exporter'...\nremote: Enumerating objects: 158, done.\nremote: Counting objects: 100% (158/158), done.\nremote: Compressing objects: 100% (112/112), done.\nremote: Total 158 (delta 63), reused 101 (delta 28), pack-reused 0\nReceiving objects: 100% (158/158), 188.37 KiB | 1.08 MiB/s, done.\nResolving deltas: 100% (63/63), done.\n$ cd p3exporter\n$ pip install -e .\n```\n\nFrom now you can run it with:\n\n```text\n$ p3exporter\nINFO:root:Collector 'example' was loaded and registred successfully\nINFO:root:Collector 'loadavg' was loaded and registred successfully\nINFO:root:Collector 'netdev' was loaded and registred successfully\nINFO:root:Start exporter, listen on 5876\n```\n\n## Building your own container image\n\nTo build your own container image you can use the dockerfile which is delivered in our github repository.\nThis file is also used to create our images on quay.io or dockerhub.\n\n```text\n$ docker build -t p3exporter .\nSending build context to Docker daemon  181.8kB\n...\nSuccessfully built a6bdf60489f5\nSuccessfully tagged p3exporter:latest\n```\n\nNow you can start the container. Here you can use the command from above. You have just to use your image\n\n```text\ndocker run -d --net=\"host\" --pid=\"host\" -v \"/:/host:ro,rslave\" p3exporter:latest\n```\n\n## Collectors\n\n| Name | Description |\n| ---- | ----------- |\n| example | example collector that actually does nothing but show how long a function has been executed |\n| loadavg | collects average load in 1, 5 and 15 minutes interval |\n| netdev | collects netword device information and statistics |\n\n### Activation and Deactivation of collectors\n\nTo activate or deactive collectors you have to configure it in `p3.yml` within the `collectors` list. All collectors listed in this list will be activated a start time of p3exporter. If there are any issues e.g. collector can't be found or has failures in code a warning will be shown and it will not be activated.\n\n```yaml\nexporter_name: \"Python prammable Prometheus exporter\"\ncollectors:\n  - example\n  - loadavg\n  - netdev\ncollector_opts:\n  netdev:\n    log_level: DEBUG\n    whitelist:\n    blacklist:\n      - docker0\n      - lo\nlogging:\n  - name: root\n    level: INFO\n  - name: foomodule.barcollector\n    level: WARNING\n    target: /path/to/my/collector/logfile.log\n```\n\nThe `collector_opts` can optionally contain a `log_level` entry which\nwill configure the logging-level for that specific collector. Note that\nsupport for this must be implemented by each individual collector.\n\nLogging can optionally be configured for any logger. The entries must\nspecify the name of the logger and can optionally specify a\nlogging-level (default: stay at whatever the default logging-level for\nthat logger is) and/or can specify a file to write the log to (default:\nlog to stderr).\n\n### Start-up Configuration\n\nYou can define two fundamental Parameters on program start-up. The following table summarized you options:\n\n| Parameter | Environment variable | Default | Description |\n| --------- | -------------------- | ------- | ----------- |\n| --config  | P3E_CONFIG | p3.yml | Path to the used configuration file |\n| --port | P3E_PORT | 5876 | TCP port on which the p3exporter listen for connections |\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcodeaffen%2Fp3exporter","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcodeaffen%2Fp3exporter","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcodeaffen%2Fp3exporter/lists"}