question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Names & Labels for jenkins_node_*_builds Metrics

See original GitHub issue

Steps to reproduce

The Jenkins node names are baked into the metric name making generic templates and queries impossible.

jenkins_node_my_node1_builds{quantile="0.5",} 0.640805186 (and other quantiles)
jenkins_node_my_node1_builds_count 99.0

jenkins_node_my_node2_builds{quantile="0.5",} 0.640805186 (and other quantiles)
jenkins_node_my_node2_builds_count 99.0

Expected behaviour

The node name should be taken out of the metric name and into a label. This allows for templating of nodes statistics and prevents manual work when adding a new node.

jenkins_node_builds{quantile="0.5",node="my_node1"} 0.640805186 (and other quantiles)
jenkins_node_builds_count 99.0 {node="my_node2"} 

jenkins_node_builds{quantile="0.5"node="my_node2"} 0.640805186 (and other quantiles)
jenkins_node_builds_count{node="my_node2"} 99.0

Server configuration

Jenkins Version: 2.235.5

Plugin Version: 2.0.8

Notify

@markyjackson-taulia

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Reactions:1
  • Comments:8 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
james-m-tubbscommented, Oct 20, 2020

I don’t mind sending a PR either!

1reaction
james-m-tubbscommented, Oct 20, 2020

@markyjackson-taulia it’s not so much for me - this is a metric naming best practice thing. Makes it a lot easier for PromQL users downstream, especially, in theory, with things like dynamic agents.

That said though, deleting the old metrics names is going to break a bunch of existing user’s dashboards. If we decide to implement i’m not sure how best to approach this. Keep old metrics with a deprecation warning? Behind a config flag maybe (i don’t even know if we can do that).

Read more comments on GitHub >

github_iconTop Results From Across the Web

Node and Label parameter - Jenkins Plugins
This plugin adds two new parameter types to job configuration - node and label. The new parameters allow dynamic selection of the node...
Read more >
Metrics - Jenkins Plugins
The metric is lazily created after the JVM starts up when the first build starts on that node. jenkins.node.offline.value (gauge). The number of ......
Read more >
Built-In Node Name and Label Migration - Jenkins
Label assignments of various project types, both on the top level (e.g. Freestyle jobs) and within jobs (e.g. node statements in Scripted Pipeline,...
Read more >
[JENKINS-59431] When using node label's "All Nodes for ...
I've 6 similar nodes, that share a label "TESTPC" when I configure the job to trigger with that label the plugin works fine...
Read more >
Prometheus Metrics plugin: label name "node" is not unique
"label name "node" is not unique: invalid sample". And the endpoint is marked as "DOWN". After checking the $JENKINS_URL/prometheus page, ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found