Jenkins Prometheus plugin pipeline metrics - jenkins

I have a pipeline in Jenkins for which I would like the Prometheus plugin to output pipeline invocation metrics like ID, when pipeline started, when it finished & status.
is this possible?
Thanks.

Related

Jenkins scripted pipeline to use different jenkins token while calling ansible playbook

I have a jenkins pipeline which is getting called from AWS lambda. The User who triggered pipeline does not have access to execute plugin which is in jenkinsfile.
Is there a way to use different jenkins token in jenkins stage or while calling the plugin something like withcredetials.

Loading jenkinsFile from local disk and run the Declarative pipeline on the same Agent

I am setting up a Jenkins locally without SCM.
I have several Pipelines with the same JenkinsFile but with different parameters.
I would like to centralize the JenkinsFile for all the pipelines.
I found a solution originally for a scripted pipeline:
node {
load "/path/to/local/jenkinsFile.groovy"
}
The problem here is that Jenkins needs two agents to run the previous pipeline (one for the loading node, the other to run the pipeline) and both of them won't finish before the end of the pipeline.
Since I have multiples pipelines cron triggered, at some point, all the agents are busy to load the pipeline files, but since there is no more available agent to run each pipeline, the Jenkins process is stuck and then there is a bottleneck in the job queue.
For solutions I imagine:
How can I release the agent after the load of the pipeline?
Is there a way at the first pipeline (load the jenkinsFile) to keep an agent for running the pipeline?

Jenkins build history for all jobs

I'am using Jenkins and I would like to have statistics of all builds executions.
I'am already using the plugin "build-metric" but pipeline jobs are not included in the statistics.
How to include pipeline jobs in the result of this plugin ? Or do you know an another plugin which include pipeline job ?

Use Jenkins Job DSL to create / modify Docker Agent Templates

On our jenkins server we are providing ~30 Docker Agent Templates for build jobs. I've successfully automated the creation of the build jobs for those images using the Jenkins Job DSL plugin. Now I'm wondering whether I could use the Job DSL plugin (or any other plugin that provides scripting) to automate the configuration of the Docker Agent Templates in the Jenkins Settings:

Jenkins pipeline job not start build while trigger from 'Bitbucket server webhook to jenkins'

Jenkins simple pipeline project not start build while trigger from 'Bitbucket server webhook to jenkins' Hook from bitbucket respository.
The same thing working perfectly with Freestyle job, but only pipeline job not start building. So bitbucket webhook configuration is proper.
bitbucket plugin configuration
Below is my pipeline job configuration.
Jenkins pipeline job triggers
And the simple pipeline script which I'm using.
Jenkins pipeline job script

Resources