Document how to specify multiple excludeMetrics The documentation mentions multiple patterns can be given by repeating the `excludeMetrics` setting but it was unclear to me how to proceed. The setting is fetched using a getStringList() which comes from jgit and indeed one just need to repeat it. An example makes it clearer. I also thought the matching was to be done against the metric names exposed to Prometheus, but it is instead done against the Gerrit metric name (`/` separated). The doc mentions the matching is done on the whole key, document that it is internally using `regex.Matcher.matches()` (and not `lookingAt()` which matches at the start of the subject). The multiple values example does use a lead carret '^' which indicates matching at the start of metric name has to be set explicitly. Change-Id: I89fd2d4bb6523446ba54f741767336f907c800ac
diff --git a/src/main/resources/Documentation/config.md b/src/main/resources/Documentation/config.md index 070151f..6c41974 100644 --- a/src/main/resources/Documentation/config.md +++ b/src/main/resources/Documentation/config.md
@@ -25,11 +25,29 @@ for how to configure the integration with Prometheus. plugin.@PLUGIN@.excludeMetrics -: Regex pattern used to exclude metrics from the report. It can be specified multiple times. - Note that pattern matching is done on the whole metric name, not only on a part of it. - By default no metric is excluded. - For example, to exclude all cache metrics, use: `excludeMetrics = cache.*` +: Regex pattern used to exclude metrics from the report. + The matching is done against the Gerrit metrics names as documented on + ['Metrics'](@URL@Documentation/metrics.html). The pattern matching is done + internally using `regex.Matcher.matches()` and can match anywhere (not + necessarly starting at the beginning of the metric name) + + By default no metric is excluded. + + For examples: + + To exclude all metrics matching `cache` at some place in their key, use: + `excludeMetrics = cache.*` + + To exclude multiple metrics: + ``` + [plugin "metrics-reporter-prometheus"] + excludeMetrics = ^http/server/rest_api/.* + excludeMetrics = ^license/cla_check_count + excludeMetrics = ^plugin/latency/.* + excludeMetrics = ^reviewer_suggestion/.* + excludeMetrics = ^sequence/next_id_latency.* + ``` [Back to @PLUGIN@ documentation index][index]