{"id":18289159,"url":"https://github.com/cmsj/prometheus-bugzilla-exporter","last_synced_at":"2025-04-09T07:16:22.706Z","repository":{"id":145773854,"uuid":"158759216","full_name":"cmsj/prometheus-bugzilla-exporter","owner":"cmsj","description":"Python tool for transforming Bugzilla 5 REST API data into Prometheus' ingest format","archived":false,"fork":false,"pushed_at":"2019-01-28T13:22:46.000Z","size":41,"stargazers_count":3,"open_issues_count":0,"forks_count":0,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-02-15T01:32:40.824Z","etag":null,"topics":["bugzilla","prometheus","prometheus-exporter"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/cmsj.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,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2018-11-22T23:33:00.000Z","updated_at":"2020-07-20T08:32:57.000Z","dependencies_parsed_at":"2023-05-17T23:15:36.528Z","dependency_job_id":null,"html_url":"https://github.com/cmsj/prometheus-bugzilla-exporter","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cmsj%2Fprometheus-bugzilla-exporter","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cmsj%2Fprometheus-bugzilla-exporter/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cmsj%2Fprometheus-bugzilla-exporter/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cmsj%2Fprometheus-bugzilla-exporter/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/cmsj","download_url":"https://codeload.github.com/cmsj/prometheus-bugzilla-exporter/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247994135,"owners_count":21030050,"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":["bugzilla","prometheus","prometheus-exporter"],"created_at":"2024-11-05T14:04:57.987Z","updated_at":"2025-04-09T07:16:22.689Z","avatar_url":"https://github.com/cmsj.png","language":"Python","readme":"[![Build Status](https://dev.azure.com/cmsj/cmsj/_apis/build/status/cmsj.prometheus-bugzilla-exporter)](https://dev.azure.com/cmsj/cmsj/_build/latest?definitionId=2)\n\n# Prometheus Bugzilla Exporter\n\n## Introduction\n\nThe purpose of this project is to export basic data about Bugzilla search results, in a format that Prometheus can consume. Specifically, as text files that can be ingested by node-exporter's textfile collector.\n\n## Requirements\n\n * You should have a directory somewhere that is being monitored by node-exporter's textfile collector\n * Python 3 (tested against 3.7)\n * The [simple_rest_client](https://pypi.org/project/simple-rest-client/) Python module\n * Bugzilla REST API (available from v5 of Bugzilla)\n\n## Installation\n\nYou have three main options here:\n\n### From Source\n\n`pip install /path/to/this/repo`\n\n### From pip\n\n`pip install prombzex`\n\n### Via Docker\n\n`docker pull cmsj/prometheus-bugzilla-exporter`\n\nNote that if you use the Docker image, there are two expected volumes to mount:\n\n * `/config.json` - The configuration file for prombzex (see Configuration below)\n * `/outdir` - A directory that the textfile outputs will be written to\n\n### Configuration\n\nPrombzex is configured via a JSON file, the path/name of which should be supplied as the only command line argument when running prombzex.\n\nThe file should look like this:\n\n```json\n{\n    \"default\": {\n        \"timeout\": 60,\n        \"output_dir\": \"/outdir\"\n    },\n    \"https://bugzilla.someproject.org\": {\n        \"output_file\": \"someproject.prom\",\n        \"name\": \"Some Project\",\n        \"api_key\": \"12345678abcdef\",\n        \"queries\": [\n            {\n                \"name\": \"my_open_bugs\",\n                \"help\": \"Count of bugs I have open right now\",\n                \"type\": \"gauge\",\n                \"query\": \"https://bugzilla.someproject.org/buglist.cgi?bug_status=__open__\u0026email1=MYEMAIL%40SOMEPROJECT.ORG\u0026emailassigned_to1=1\u0026emailtype1=substring\u0026list_id=9810932\u0026query_format=advanced\"\n            },\n            {\n                \"name\": \"my_closed_all_time\",\n                \"help\": \"Count of bugs I've ever closed\",\n                \"type\": \"counter\",\n                \"query\": \"https://bugzilla.someproject.org/buglist.cgi?bug_status=__closed__\u0026email1=MYEMAIL%40SOMRPROJECT.ORG\u0026emailassigned_to1=1\u0026emailtype1=substring\u0026list_id=9810932\u0026query_format=advanced\"\n            }\n        ]\n    },\n    \"https://bugzilla.othergroup.net\": {\n        \"output_file\": \"othergroup.prom\",\n        \"name\": \"Other Group\",\n        \"api_key\": \"abcdef1234568\",\n        \"queries\": [\n            {\n                \"name\": \"some_query_name\",\n                \"help\": \"Some interesting query\",\n                \"type\": \"gauge\",\n                \"group_field\": \"status\",\n                \"params\": [\n                    { \"key\": \"status\", \"value\": \"__open__\" },\n                    { \"key\": \"f1\", \"value\": \"assigned_to\" },\n                    { \"key\": \"o1\", \"value\": \"substring\" },\n                    { \"key\": \"v1\", \"value\": \"helpfulcorp.com\" },\n                    { \"key\": \"list_id\", \"value\": \"12345678\" },\n                    { \"key\": \"query_format\", \"value\": \"advanced\" },\n                    { \"key\": \"include_fields\", \"value\": [\"id\", \"status\"] }\n                ]\n            }\n        ]\n    }\n}\n```\n\nObviously, some explanation is required here!\n\nThe structure is that there should be dictionaries for each Bugzilla server you want to talk to and optionally a `default` dictionary to provide default values that may be overidden in some of the server configs.\n\nThe keys available in each server are:\n\nNote that the URL for the server is the key in the top-level dictionary. Hostnames specified in a `query` field are ignored, only the query parameters are parsed.\n\n * `name`: A friendly name for the Bugzilla server\n * `api_key`: The API key you obtain from your Bugzilla preferences\n * `queries`: An array of dictionaries, each of which defines a search query to run against the server (see below)\n * `timeout`: A number of seconds to wait before giving up on search queries. The underlying default in `simple_rest_client` is a few seconds and is likely to be much too short for even moderately complex Bugzilla queries. Strongly consider setting a high timeout in the `default` section of your `config.json`.\n * `output_dir`: The directory where output files should be written - in the case of Docker, to match the Dockerfile, you should set this in `default` to `/outdir`.\n * `output_file`: The filename to create in `output_dir` with the Prometheus values. There is no particular need for this to be specified per-server, but you may prefer that layout. Note that for the textfile collector to notice the file, it must end with `.prem`.\n\nThe keys available on queries are:\n\n * `name`: A Prometheus-compatible name to uniquely identify the query\n * `help`: A human-compatible description of the data the query represents\n * `type`: At the moment, only `gauge` and `counter` are supported - these are hints to Prometheus for whether the value can go up and down, or only up (respectively).\n * `group_field`: (optional) If present, this field will group the results by a given field in the output (it by a particular column in the Bugzilla results). Useful if you want to do things like separate graph lines for different bug states with `group_field` set to `status` (assuming the Status column is included in your result fields)\n * `query`: A complete Bugzilla URL, which you should generate using the normal Bugzilla advanced search interface.\n * `params`: A representation of all of the query parameters from a complete Bugzilla URL. This is easier to read than a complete Bugzilla URL, but harder to create and doesn't offer any strong benefits unless you will be editing the query a lot.\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcmsj%2Fprometheus-bugzilla-exporter","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcmsj%2Fprometheus-bugzilla-exporter","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcmsj%2Fprometheus-bugzilla-exporter/lists"}