You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
By default, it exposes the metrics on :8080/metrics. You have to configure at least sonarqube.token in the config,
see below.
Exit codes
0: Everything is fine
1: Unexpected error
2: Config couldn't be loaded
Configuration
Configuration is loaded from config.toml from the current working directory.
Most options have sane defaults, but you must set sonarqube.token!
[server]
hostname = "0.0.0.0"# Address to bind toport = 8080# Port to bind tomin_threads = 1# Minimum http threadsmax_threads = 8# Maximum http threads
[sonarqube]
url = "https://localhost:9000/"# URL to SonarQubetoken = "xxxxx"# SonarQube authentication token (My Account / Security) scrape_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)
[prometheus]
metrics_path = "/metrics"# URL to publish prometheus metrics
[projects]
include = [] # Project ids to includeexclude = [] # Project ids to exclude
[metrics]
include = [] # Metrics to includeexclude = [] # Metrics to exclude
[branches]
include = [] # Branches to includeexclude = [] # Branches to exclude
Including / excluding
If the include list is non-empty, the project id / metric has to be in the list to be included.
Otherwise the exclude list is checked for the project id / metric.
Example:
[projects]
include = ["your.project:id"]
exclude = []
Only the project your.project:id will be scraped from SonarQube, all others are ignored.
Another example:
[projects]
include = []
exclude = ["your.project:id"]
All projects will be scraped, except the project your.project:id.
Metric mapping
Levels
The metric type LEVEL is mapped as follows:
OK -> 0.0
WARN -> 1.0
ERROR -> 2.0
FAQ
How do I get a SonarQube token?
Log in into your SonarQube instance and click your user icon in the top right corner. Select "My Account", switch to the
"Security" tab and generate a new token.