Skip to content
This repository has been archived by the owner on Oct 23, 2024. It is now read-only.

Commit

Permalink
Add excludeJobMetrics parameter available on collectd-jenkins v2.4.0 (#…
Browse files Browse the repository at this point in the history
  • Loading branch information
ttwd80 authored Apr 8, 2021
1 parent 79cc184 commit d442dab
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 0 deletions.
1 change: 1 addition & 0 deletions docs/monitors/collectd-jenkins.md
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,7 @@ Configuration](../monitor-config.md#common-configuration).**
| `path` | no | `string` | |
| `metricsKey` | **yes** | `string` | Key required for collecting metrics. The access key located at `Manage Jenkins > Configure System > Metrics > ADD.` If empty, click `Generate`. |
| `enhancedMetrics` | no | `bool` | Whether to enable enhanced metrics (**default:** `false`) |
| `excludeJobMetrics` | no | `bool` | Set to *true* to to exclude job metrics retrieved from `/api/json` endpoint (**default:** `false`) |
| `includeMetrics` | no | `list of strings` | Used to enable individual enhanced metrics when `enhancedMetrics` is false |
| `username` | no | `string` | User with security access to jenkins |
| `apiToken` | no | `string` | API Token of the user |
Expand Down
3 changes: 3 additions & 0 deletions pkg/monitors/collectd/jenkins/jenkins.go
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,8 @@ type Config struct {
MetricsKey string `yaml:"metricsKey" validate:"required"`
// Whether to enable enhanced metrics
EnhancedMetrics *bool `yaml:"enhancedMetrics"`
// Set to *true* to to exclude job metrics retrieved from `/api/json` endpoint
ExcludeJobMetrics *bool `yaml:"excludeJobMetrics"`
// Used to enable individual enhanced metrics when `enhancedMetrics` is
// false
IncludeMetrics []string `yaml:"includeMetrics"`
Expand Down Expand Up @@ -82,6 +84,7 @@ func (m *Monitor) Configure(conf *Config) error {
"Interval": conf.IntervalSeconds,
"MetricsKey": conf.MetricsKey,
"EnhancedMetrics": conf.EnhancedMetrics,
"ExcludeJobMetrics": conf.ExcludeJobMetrics,
"Username": conf.Username,
"APIToken": conf.APIToken,
"ssl_keyfile": conf.SSLKeyFile,
Expand Down
8 changes: 8 additions & 0 deletions selfdescribe.json
Original file line number Diff line number Diff line change
Expand Up @@ -12637,6 +12637,14 @@
"type": "bool",
"elementKind": ""
},
{
"yamlName": "excludeJobMetrics",
"doc": "Set to *true* to to exclude job metrics retrieved from `/api/json` endpoint",
"default": "false",
"required": false,
"type": "bool",
"elementKind": ""
},
{
"yamlName": "includeMetrics",
"doc": "Used to enable individual enhanced metrics when `enhancedMetrics` is false",
Expand Down

0 comments on commit d442dab

Please sign in to comment.