Uploaded image for project: 'Jenkins'
  1. Jenkins
  2. JENKINS-47696

Rename metric "metric.jenkins.node.[count|offline|online]" to metric.jenkins.allnodes.[count|offline|online]

    XMLWordPrintable

    Details

    • Type: Improvement
    • Status: Resolved (View Workflow)
    • Priority: Minor
    • Resolution: Won't Fix
    • Component/s: metrics-plugin
    • Labels:
      None
    • Environment:
      Jenkins 2.73.2
      Metrics Plugin 3.1.2.10
      CentOS 7.4
      Java OpenJDK 1.8.0_141
    • Similar Issues:

      Description

      Background:

      We monitor Jenkins with Prometheus and scrape the metrics produced by the metrics-plugin with the jmx-exporter (https://github.com/prometheus/jmx_exporter).

      Furthermore, our slaves are ephemeral resulting in different slaves for different builds.

      Motivation:

      Exposed as mBeans and visible via JMX, we see metrics for our slaves denoted by e.g.

      metrics_jenkins_node_scaler_int_i_192_168_148_102_java_4966cfa5_builds_98thPercentile 0.0

      To make maximal use of this metric, Prometheus needs it so scrape in a form like

      metrics_jenkins_node_builds{name="scaler_int_i_192_168_148_102_java_4966cfa5", quantile="0.98"} 0.0
      

      Such a rewriting can be done with help of rules in the configuration of the JMX-Exporter: https://github.com/prometheus/jmx_exporter#configuration

      Problem:

      To generate rules, we need to apply a regex on the mBean. The prefix "node" would fit perfectly to file for. Unfortunately, the same prefix is used for the following, global node staticstic:

      • jenkins.node.count.*
      • jenkins.node.offline.*
      • jenkins.node.online.*

      This prohibits a filtering on node-specifics metrics.

      Proposal:

      Renaming of 

      • jenkins.node.count.*
      • jenkins.node.offline.*
      • jenkins.node.online.*

      to 

      • jenkins.allnodes.count.*
      • jenkins.allnodes.offline.*
      • jenkins.allnodes.online.*

      The affected Lines are marked over https://github.com/jenkinsci/metrics-plugin/blob/d94a4547b11263c094b2f713b37f7f0610882878/src/main/java/jenkins/metrics/impl/JenkinsMetricProviderImpl.java#L305,L319 

       

        Attachments

          Activity

          Hide
          sbb_wzu MWZ-WZU SBB added a comment - - edited
          Show
          sbb_wzu MWZ-WZU SBB added a comment - - edited I created  https://github.com/jenkinsci/metrics-plugin/pull/27/files  to solve this issue.
          Hide
          stephenconnolly Stephen Connolly added a comment -

          Would break existing consumers of the metrics names

          Show
          stephenconnolly Stephen Connolly added a comment - Would break existing consumers of the metrics names

            People

            Assignee:
            Unassigned Unassigned
            Reporter:
            sbb_wzu MWZ-WZU SBB
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

              Dates

              Created:
              Updated:
              Resolved: