{ "info": { "author": "Chris Jones", "author_email": "cmsj@tenshu.net", "bugtrack_url": null, "classifiers": [ "License :: OSI Approved :: MIT License", "Operating System :: OS Independent", "Programming Language :: Python :: 3" ], "description": "[![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__&email1=MYEMAIL%40SOMEPROJECT.ORG&emailassigned_to1=1&emailtype1=substring&list_id=9810932&query_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__&email1=MYEMAIL%40SOMRPROJECT.ORG&emailassigned_to1=1&emailtype1=substring&list_id=9810932&query_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\n\n", "description_content_type": "text/markdown", "docs_url": null, "download_url": "", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "https://github.com/cmsj/prombzex", "keywords": "", "license": "", "maintainer": "", "maintainer_email": "", "name": "prombzex", "package_url": "https://pypi.org/project/prombzex/", "platform": "", "project_url": "https://pypi.org/project/prombzex/", "project_urls": { "Homepage": "https://github.com/cmsj/prombzex" }, "release_url": "https://pypi.org/project/prombzex/0.3/", "requires_dist": null, "requires_python": "", "summary": "Prometheus Bugzilla Exporter", "version": "0.3" }, "last_serial": 4600036, "releases": { "0.1": [ { "comment_text": "", "digests": { "md5": "08b60e60fd42f0063da1025d64802d1b", "sha256": "43952340e542b38a204c3ff011d5221e1eeb4fac1076f17838ccef68f5b46c5f" }, "downloads": -1, "filename": "prombzex-0.1-py3-none-any.whl", "has_sig": false, "md5_digest": "08b60e60fd42f0063da1025d64802d1b", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": null, "size": 6901, "upload_time": "2018-12-11T17:15:16", "url": "https://files.pythonhosted.org/packages/f2/99/55f4bdc1ecf8cc20d544044920d1f092056bf9478da5c45eb036eb8ecbb5/prombzex-0.1-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "4f9135430a1ab42818c287fcbbf9b13a", "sha256": "b07313aaf643935eff9195fccb88506840b58e059ed5aa11c5cf66d234339190" }, "downloads": -1, "filename": "prombzex-0.1.tar.gz", "has_sig": false, "md5_digest": "4f9135430a1ab42818c287fcbbf9b13a", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 4328, "upload_time": "2018-12-11T17:15:19", "url": "https://files.pythonhosted.org/packages/3a/8c/c7d18abb467e9b51b24f81313fdfe032348b9ffb2874ece31e95d9de867d/prombzex-0.1.tar.gz" } ], "0.2": [ { "comment_text": "", "digests": { "md5": "2057e792bbad35840a7cc8393d5f3401", "sha256": "526f4e67d4439921b138b370492e0fb0121834191c5672b68344ea9546a09cbf" }, "downloads": -1, "filename": "prombzex-0.2-py3-none-any.whl", "has_sig": false, "md5_digest": "2057e792bbad35840a7cc8393d5f3401", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": null, "size": 9350, "upload_time": "2018-12-14T16:36:59", "url": "https://files.pythonhosted.org/packages/b5/cb/a337f35f73cd98b02b037b95c7be5e4b1328926457440fc7a9c40334016d/prombzex-0.2-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "a432d59df77c030e6ce73b032fc82251", "sha256": "5ad1e4fcd9212bd9c6c75a783617751996aa16917d096b2a65a4d8e950f73c5d" }, "downloads": -1, "filename": "prombzex-0.2.tar.gz", "has_sig": false, "md5_digest": "a432d59df77c030e6ce73b032fc82251", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 7105, "upload_time": "2018-12-14T16:37:00", "url": "https://files.pythonhosted.org/packages/1e/bd/d4d3f0f35bb12ff00aa64d0b9f626679e5a76de6afc69e9fe52aadd74b2a/prombzex-0.2.tar.gz" } ], "0.3": [ { "comment_text": "", "digests": { "md5": "2a9ee9a0bfe09c8858bd4966014a6967", "sha256": "e371ff55c8a4fd2f5ff767ec9beb602e9f049d4ce5104817c53e748da7f5d7e5" }, "downloads": -1, "filename": "prombzex-0.3-py3-none-any.whl", "has_sig": false, "md5_digest": "2a9ee9a0bfe09c8858bd4966014a6967", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": null, "size": 9351, "upload_time": "2018-12-14T16:40:55", "url": "https://files.pythonhosted.org/packages/a5/5a/be99eaadacd633baf5b543b443a158611d0e0a5b2707f67b538acdda87d5/prombzex-0.3-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "60405ef97c2054465d9de00387bd143d", "sha256": "724358e053007fb305b7169ec907889505956a9279ed134f35fc2910937c9a3d" }, "downloads": -1, "filename": "prombzex-0.3.tar.gz", "has_sig": false, "md5_digest": "60405ef97c2054465d9de00387bd143d", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 7104, "upload_time": "2018-12-14T16:40:57", "url": "https://files.pythonhosted.org/packages/78/9d/282fda82fb0dcda1bcdfc5a563983504acfee2be2b9dc7f62bed4f04fd21/prombzex-0.3.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "2a9ee9a0bfe09c8858bd4966014a6967", "sha256": "e371ff55c8a4fd2f5ff767ec9beb602e9f049d4ce5104817c53e748da7f5d7e5" }, "downloads": -1, "filename": "prombzex-0.3-py3-none-any.whl", "has_sig": false, "md5_digest": "2a9ee9a0bfe09c8858bd4966014a6967", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": null, "size": 9351, "upload_time": "2018-12-14T16:40:55", "url": "https://files.pythonhosted.org/packages/a5/5a/be99eaadacd633baf5b543b443a158611d0e0a5b2707f67b538acdda87d5/prombzex-0.3-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "60405ef97c2054465d9de00387bd143d", "sha256": "724358e053007fb305b7169ec907889505956a9279ed134f35fc2910937c9a3d" }, "downloads": -1, "filename": "prombzex-0.3.tar.gz", "has_sig": false, "md5_digest": "60405ef97c2054465d9de00387bd143d", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 7104, "upload_time": "2018-12-14T16:40:57", "url": "https://files.pythonhosted.org/packages/78/9d/282fda82fb0dcda1bcdfc5a563983504acfee2be2b9dc7f62bed4f04fd21/prombzex-0.3.tar.gz" } ] }