{"id":19486511,"url":"https://github.com/phxql/sonarqube-to-prometheus","last_synced_at":"2025-08-31T03:41:31.661Z","repository":{"id":146609040,"uuid":"326010271","full_name":"phxql/sonarqube-to-prometheus","owner":"phxql","description":"Exports SonarQube metrics to Prometheus","archived":false,"fork":false,"pushed_at":"2021-01-03T10:52:13.000Z","size":146,"stargazers_count":3,"open_issues_count":2,"forks_count":0,"subscribers_count":3,"default_branch":"main","last_synced_at":"2025-02-25T18:47:50.271Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Java","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"agpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/phxql.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","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":"2021-01-01T16:01:16.000Z","updated_at":"2022-07-27T14:04:11.000Z","dependencies_parsed_at":null,"dependency_job_id":"92e4a9d6-2015-4344-9a48-b0c0f9229d3d","html_url":"https://github.com/phxql/sonarqube-to-prometheus","commit_stats":null,"previous_names":[],"tags_count":2,"template":false,"template_full_name":null,"purl":"pkg:github/phxql/sonarqube-to-prometheus","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/phxql%2Fsonarqube-to-prometheus","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/phxql%2Fsonarqube-to-prometheus/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/phxql%2Fsonarqube-to-prometheus/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/phxql%2Fsonarqube-to-prometheus/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/phxql","download_url":"https://codeload.github.com/phxql/sonarqube-to-prometheus/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/phxql%2Fsonarqube-to-prometheus/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":272936301,"owners_count":25018160,"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","status":"online","status_checked_at":"2025-08-31T02:00:09.071Z","response_time":79,"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":[],"created_at":"2024-11-10T20:38:06.798Z","updated_at":"2025-08-31T03:41:31.611Z","avatar_url":"https://github.com/phxql.png","language":"Java","funding_links":[],"categories":[],"sub_categories":[],"readme":"# SonarQube to Prometheus\n\n![build](https://github.com/phxql/sonarqube-to-prometheus/workflows/build/badge.svg)\n\nExports SonarQube metrics to Prometheus.\n\nIt scrapes the SonarQube server at a configurable interval and extracts measures for all metrics on all projects on all\nbranches.\n\n## Running\n\nDownload the JAR file from the latest [release](https://github.com/phxql/sonarqube-to-prometheus/releases), install\na [JVM](https://adoptopenjdk.net/), and run this:\n\n```shell\njava -XX:+UseSerialGC -Xms16M -Xmx128M -jar sonarqube-to-prometheus-*.jar\n```\n\nTo quit, press `Ctrl+C`.\n\nBy default, it exposes the metrics on `:8080/metrics`. You have to configure at least `sonarqube.token` in the config,\nsee below.\n\n### Exit codes\n\n* `0`: Everything is fine\n* `1`: Unexpected error\n* `2`: Config couldn't be loaded\n\n## Configuration\n\nConfiguration is loaded from `config.toml` from the current working directory.\n\nMost options have sane defaults, but you must set `sonarqube.token`!\n\n```toml\n[server]\nhostname = \"0.0.0.0\" # Address to bind to\nport = 8080 # Port to bind to\nmin_threads = 1 # Minimum http threads\nmax_threads = 8 # Maximum http threads\n\n[sonarqube]\nurl = \"http://localhost:9000/\" # URL to SonarQube\ntoken = \"xxxxx\" # SonarQube authentication token (My Account / Security) \nscrape_interval = \"PT1H\" # How often should SonarQube be scraped? PT1M is 1 minute, PT1H is 1 hour, etc. See https://docs.oracle.com/en/java/javase/11/docs/api/java.base/java/time/Duration.html#parse(java.lang.CharSequence)\n\n[prometheus]\nmetrics_path = \"/metrics\" # URL to publish prometheus metrics\n\n[projects]\ninclude = [] # Project ids to include\nexclude = [] # Project ids to exclude\n\n[metrics]\ninclude = [] # Metrics to include\nexclude = [] # Metrics to exclude\n\n[branches]\ninclude = [] # Branches to include\nexclude = [] # Branches to exclude\n```\n\n### Including / excluding\n\nIf the include list is non-empty, the project id / metric has to be in the list to be included.\n\nOtherwise the exclude list is checked for the project id / metric.\n\nExample:\n\n```toml\n[projects]\ninclude = [\"your.project:id\"]\nexclude = []\n```\n\nOnly the project `your.project:id` will be scraped from SonarQube, all others are ignored.\n\nAnother example:\n\n```toml\n[projects]\ninclude = []\nexclude = [\"your.project:id\"]\n```\n\nAll projects will be scraped, except the project `your.project:id`.\n\n## Metric mapping\n\n### Levels\n\nThe metric type `LEVEL` is mapped as follows:\n\n* `OK` -\u003e 0.0\n* `WARN` -\u003e 1.0\n* `ERROR` -\u003e 2.0\n\n## FAQ\n\n### How do I get a SonarQube token?\n\nLog in into your SonarQube instance and click your user icon in the top right corner. Select \"My Account\", switch to the\n\"Security\" tab and generate a new token.\n\n## Changelog\n\n[See here](CHANGELOG.md)\n\n## License\n\n[AGPLv3](https://www.gnu.org/licenses/agpl-3.0.txt)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fphxql%2Fsonarqube-to-prometheus","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fphxql%2Fsonarqube-to-prometheus","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fphxql%2Fsonarqube-to-prometheus/lists"}