Docs » Integrations Guide » Use the Smart Agent » Monitors » collectd/jenkins

collectd/jenkins 🔗

Monitor Type: collectd/jenkins (Source)

Accepts Endpoints: Yes

Multiple Instances Allowed: Yes

Overview 🔗

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).

Install Jenkins Metrics Plugin 🔗

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.

Example Config 🔗

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

Configuration 🔗

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
useHTTPS no bool Whether to enable HTTPS. (default: false)
sslKeyFile no string Path to the keyfile
sslCertificate no string Path to the certificate
sslCACerts no string Path to the ca file
skipVerify no bool Skip SSL certificate validation (default: false)

Metrics 🔗

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 instance
  • gauge.jenkins.node.executor.in-use.value (gauge)
    Total number of executors being used in an instance
  • gauge.jenkins.node.health-check.score (gauge)
    Mean health score of an instance
  • gauge.jenkins.node.health.disk.space (gauge)
    Binary value of disk space health
  • gauge.jenkins.node.health.plugins (gauge)
    Boolean value indicating state of plugins
  • gauge.jenkins.node.health.temporary.space (gauge)
    Binary value of temporary space health
  • gauge.jenkins.node.health.thread-deadlock (gauge)
    Boolean value indicating a deadlock
  • gauge.jenkins.node.online.status (gauge)
    Boolean value of instance is reachable or not
  • gauge.jenkins.node.queue.size.value (gauge)
    Total number pending jobs in queue
  • gauge.jenkins.node.slave.online.status (gauge)
    Boolean value for slave is reachable or not
  • gauge.jenkins.node.vm.memory.heap.usage (gauge)
    Percent utilization of the heap memory
  • gauge.jenkins.node.vm.memory.non-heap.used (gauge)
    Total amount of non-heap memory used
  • gauge.jenkins.node.vm.memory.total.used (gauge)
    Total Memory used by instance

Non-default metrics (version 4.7.0+) 🔗

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.