Monitor Type: collectd/jenkins
(Source)
Accepts Endpoints: Yes
Multiple Instances Allowed: Yes
Monitors jenkins by using the jenkins collectd Python plugin, which collects metrics from Jenkins instances by hitting these endpoints: ../api/json (job metrics) and metrics/<MetricsKey>/.. (default and optional Codahale/Dropwizard JVM metrics).
Requires Jenkins 1.580.3 or later, as well as the Jenkins Metrics Plugin (see Setup).
This monitor requires the Metrics Plugin in Jenkins. Go to Manage Jenkins -> Manage Plugins -> Available -> Search "Metrics Plugin"
to find and install this plugin in your Jenkins UI.
Sample YAML configuration:
monitors:
- type: collectd/jenkins
host: 127.0.0.1
port: 8080
metricsKey: reallylongmetricskey
Sample YAML configuration with specific enhanced metrics included
monitors:
- type: collectd/jenkins
host: 127.0.0.1
port: 8080
metricsKey: reallylongmetricskey
includeMetrics:
- "vm.daemon.count"
- "vm.terminated.count"
Sample YAML configuration with all enhanced metrics included
monitors:
- type: collectd/jenkins
host: 127.0.0.1
port: 8080
metricsKey: reallylongmetricskey
enhancedMetrics: true
To activate this monitor in the Smart Agent, add the following to your agent config:
monitors: # All monitor config goes under this key
- type: collectd/jenkins
... # Additional config
For a list of monitor options that are common to all monitors, see Common Configuration.
Config option | Required | Type | Description |
---|---|---|---|
pythonBinary |
no | string |
Path to a python binary that should be used to execute the Python code. If not set, a built-in runtime will be used. Can include arguments to the binary as well. |
host |
yes | string |
|
port |
yes | integer |
|
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 ) |
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 |
sslKeyFile |
no | string |
Path to the keyfile |
sslCertificate |
no | string |
Path to the certificate |
sslCACerts |
no | string |
Path to the ca file |
These are the metrics available for this monitor. Metrics that are categorized as container/host (default) are in bold and italics in the list below.
gauge.jenkins.job.duration
(gauge)
Time taken to complete the job in ms.gauge.jenkins.node.executor.count.value
(gauge)
Total Number of executors in an instancegauge.jenkins.node.executor.in-use.value
(gauge)
Total number of executors being used in an instancegauge.jenkins.node.health-check.score
(gauge)
Mean health score of an instancegauge.jenkins.node.health.disk.space
(gauge)
Binary value of disk space healthgauge.jenkins.node.health.plugins
(gauge)
Boolean value indicating state of pluginsgauge.jenkins.node.health.temporary.space
(gauge)
Binary value of temporary space healthgauge.jenkins.node.health.thread-deadlock
(gauge)
Boolean value indicating a deadlockgauge.jenkins.node.online.status
(gauge)
Boolean value of instance is reachable or notgauge.jenkins.node.queue.size.value
(gauge)
Total number pending jobs in queuegauge.jenkins.node.slave.online.status
(gauge)
Boolean value for slave is reachable or notgauge.jenkins.node.vm.memory.heap.usage
(gauge)
Percent utilization of the heap memorygauge.jenkins.node.vm.memory.non-heap.used
(gauge)
Total amount of non-heap memory usedgauge.jenkins.node.vm.memory.total.used
(gauge)
Total Memory used by instance
The following information applies to the agent version 4.7.0+ that has
enableBuiltInFiltering: true
set on the top level of the agent config.
To emit metrics that are not default, you can add those metrics in the
generic monitor-level extraMetrics
config option. Metrics that are derived
from specific configuration options that do not appear in the above list of
metrics do not need to be added to extraMetrics
.
To see a list of metrics that will be emitted you can run agent-status monitors
after configuring this monitor in a running agent instance.
The following information only applies to agent version older than 4.7.0. If
you have a newer agent and have set enableBuiltInFiltering: true
at the top
level of your agent config, see the section above. See upgrade instructions in
Old-style whitelist filtering.
If you have a reference to the whitelist.json
in your agent's top-level
metricsToExclude
config option, and you want to emit metrics that are not in
that whitelist, then you need to add an item to the top-level
metricsToInclude
config option to override that whitelist (see Inclusion
filtering. Or you can just
copy the whitelist.json, modify it, and reference that in metricsToExclude
.