Git Product home page Git Product logo

collectd-jenkins's Introduction

collectd jenkins Plugin

A Jenkins collectd plugin which users can use to send metrics from Jenkins instances to SignalFx.

Installation

  • Checkout this repository somewhere on your system accessible by collectd. The suggested location is /usr/share/collectd/
  • Install the Python requirements with sudo pip install -r requirements.txt
  • Install the Metrics Plugin in Jenkins. Manage Jenkins > Manage Plugins > Available > Search "Metrics Plugin"
  • Configure the plugin (see below)
  • Restart collectd

Requirements

  • collectd 4.9 or later (for the Python plugin)
  • Python 2.7 or later
  • Jenkins 1.580.3 or later
  • Metrics Plugin(see installation steps)

Configuration

The following are required configuration keys:

  • Host - Required. Hostname or IP address of the etcd member, default is 'localhost'
  • Port - Required. The port of the jenkins instance, default is '8080'
  • MetricsKey - Required. The access key from Manage Jenkins > Configure System > Metrics > ADD. If empty, click Generate

Optional configurations keys include:

  • Interval - Interval between metric calls. Default is 10s
  • Username - user id with access, if any. Username will require APIToken too
  • APIToken - API token from the system configuration in Jenkins. Username > Configure > API Token > Show API Token
  • Path - URL prefix to use in the HTTP request
  • EnhancedMetrics - Flag to specify whether advanced stats from the /metrics/<MetricsKey>/metrics endpoint are needed. Default is False
  • IncludeMetric - Advanced Metrics from the /metrics/<MetricsKey>/metrics endpoint can be included individually
  • ExcludeMetric - Advanced Metrics from the /metrics/<MetricsKey>/metrics endpoint can be excluded individually
  • Dimension - Add extra dimensions to your metrics
  • ExcludeJobMetrics - Flag to specify whether to exclude calls to /json/api for all jobs and builds.

SSL/TLS

  • ssl_enabled - True to perform HTTP requests over TLS. Default is False
  • ssl_cert_validation - False to skip certificate validation. Default is True

To enable client certificate authentication specify these options:

  • ssl_keyfile - path to file
  • ssl_certificate - path to file

Provide a custom file that lists trusted CA certificates, required when keyfile and certificate are provided or the server certificate is not signed by a system CA:

  • ssl_ca_certs - path to file

From /metrics/<MetricsKey>/metrics only the metrics inside gauges key are representable, if the value is a number. Metrics of type histograms, meter and timer will be skipped over. Check out https://wiki.jenkins.io/display/JENKINS/Metrics+Plugin for description of the metrics.

Note that multiple Jenkins instances can be configured in the same file.

LoadPlugin python
<Plugin python>
    ModulePath "/usr/share/collectd/collectd-jenkins"
    Import jenkins
    <Module jenkins>
        Host "localhost"
        Port "8080"
        Username "john"
        APIToken "f04fff7c860d884f2ef00a2b2d481c2f"
        MetricsKey "6ZHwGBkGR91dxbFenpfz_g2h0-ocmK-CvdHLdmg"
        Interval 10
    </Module>
    <Module jenkins>
        Host "localhost"
        Port "8010"
        Username "admin"
        APIToken "f04bbb7c860d8b4f1ef00a2b2d481c2f"
        MetricsKey "6Z76HwGBHOj4uBOlsxbFenpfz_g2UAh0-ocmK-CvdHLSRdmg"
        EnhancedMetrics False
        IncludeMetric "vm.daemon.count"
        IncludeMetric "vm.terminated.count"
    </Module>
    <Module jenkins>
        Host "localhost"
        Port "8000"
        MetricsKey "6Z95HwOj4uBOakGR91dxbFenpfz_g2wBlUAh0-ocmK-CvdSvE1LGRdmg"
        EnhancedMetrics True
        ExcludeMetric "vm.terminated.count"
        ExcludeMetric "vm.daemon.count"
        Dimension foo bar
    </Module>
</Plugin>

collectd-jenkins's People

Contributors

charless-splunk avatar dtcimbal avatar keitwb avatar markyam avatar matt-sm avatar molner avatar nishantagarwal1990 avatar paulchoi avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.