{"id":20314570,"url":"https://github.com/release-engineering/pipeline-run-prometheus-counter","last_synced_at":"2025-07-20T04:33:42.564Z","repository":{"id":53310535,"uuid":"346831999","full_name":"release-engineering/pipeline-run-prometheus-counter","owner":"release-engineering","description":"A simple app that allows a pipeline (e.g. Tekton, Jenkins) to increment a pipeline run counter for Prometheus","archived":false,"fork":false,"pushed_at":"2021-03-31T16:52:46.000Z","size":35,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":9,"default_branch":"master","last_synced_at":"2025-03-04T08:45:12.289Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"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/release-engineering.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2021-03-11T20:43:26.000Z","updated_at":"2021-03-31T16:52:46.000Z","dependencies_parsed_at":"2022-08-26T07:51:28.376Z","dependency_job_id":null,"html_url":"https://github.com/release-engineering/pipeline-run-prometheus-counter","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/release-engineering/pipeline-run-prometheus-counter","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/release-engineering%2Fpipeline-run-prometheus-counter","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/release-engineering%2Fpipeline-run-prometheus-counter/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/release-engineering%2Fpipeline-run-prometheus-counter/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/release-engineering%2Fpipeline-run-prometheus-counter/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/release-engineering","download_url":"https://codeload.github.com/release-engineering/pipeline-run-prometheus-counter/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/release-engineering%2Fpipeline-run-prometheus-counter/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":266067295,"owners_count":23871328,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","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":[],"created_at":"2024-11-14T18:15:53.186Z","updated_at":"2025-07-20T04:33:42.528Z","avatar_url":"https://github.com/release-engineering.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Pipeline Run Prometheus Counter\n\n![GitHub Actions](https://github.com/release-engineering/pipeline-run-prometheus-counter/actions/workflows/tests.yml/badge.svg)\n[![Docker Repository on Quay](https://quay.io/repository/factory2/pipeline-run-prometheus-counter/status \"Docker Repository on Quay\")](https://quay.io/repository/factory2/pipeline-run-prometheus-counter)\n\nExpose counter metrics for various pipeline runs for the Prometheus text format.\n\nThis is useful if you have a pipeline such as Tekton or Jenkins and you need\nto keep track of success and/or failure rates of Pipeline runs in Prometheus.\n\nThese pipeline runs are stored in a simple SQLite database.\n\n## HTTP Endpoints\n\nYou may view the Prometheus metrics at the `/metrics` endpoint. The ouput\nwill be in the following format:\n\n```text\n# HELP car_factory_pipeline_run_total The total number of car_factory pipeline runs.\n# TYPE pipeline_tests_pipeline_run_total counter\ncar_factory_pipeline_run_total{status=\"success\"} 1\ncar_factory_pipeline_run_total{status=\"failure\"} 1\n```\n\nTo add a pipeline run, submit a POST request to the `/metrics` endpoint with\nthe `name` and `success` properties. For example:\n\n```json\n{\n    \"name\": \"car_factory\",\n    \"success\": true\n}\n```\n\nWhen authentication is enabled, you must also pass in the header\n`Authorization: PRPC \u003cpre-shared key\u003e` (excluding the `\u003c` and `\u003e`).\n\n## Configuration\n\nThe path to the SQLite database is configured by the `PRPC_DB_PATH`\nenvironment variable. This defaults to `prpc.db` in the current directory of\nexecution.\n\nTo enable authentication based on a pre-shared key, you may set the `PRPC_PSK` environment\nvariable with the desired pre-shared key.\n\n## Dependency Management\n\nTo manage dependencies, this project uses [pip-tools](https://github.com/jazzband/pip-tools) so that\nthe production dependencies are pinned and the hashes of the dependencies are verified during\ninstallation.\n\nThe unpinned dependencies are recorded in `setup.py`, and to generate the `requirements.txt` file,\nrun `pip-compile --generate-hashes --output-file=requirements.txt`. This is only necessary when\nadding a new package. To upgrade a package, use the `-P` argument of the `pip-compile` command.\n\nWhen installing the dependencies in a production environment, run\n`pip install --require-hashes -r requirements.txt`. Alternatively, you may use\n`pip-sync requirements.txt`, which will make sure your virtualenv only has the packages listed in\n`requirements.txt`.\n\nTo ensure the pinned dependencies are not vulnerable, this project uses\n[safety](https://github.com/pyupio/safety), which runs on every pull-request.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frelease-engineering%2Fpipeline-run-prometheus-counter","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Frelease-engineering%2Fpipeline-run-prometheus-counter","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frelease-engineering%2Fpipeline-run-prometheus-counter/lists"}