Closed DeekshithSN closed 1 year ago
I experience the same issue when the authentication is enabled. With disabled authentication, metrics are displayed by the endpoint properly.
Are scrape configs in place?
Haven't tried to configure Prometheus since the endpoint doesn't return anything with enabled authentication.
Can be tested with the browser or with curl:
curl --insecure --user <user> <url>/prometheus
It won’t return anything if there is no data to return. You have to have the scrape config in place following the setup instructions. If you need a sample scrape config, here is one:
scrape_configs:
- job_name: 'prometheus'
scrape_interval: 5s
static_configs:
- targets: ['localhost:9090']
- job_name: 'jenkins'
metrics_path: '/prometheus'
scrape_interval: 15s
basic_auth:
username: '<username>'
password: '<password>'
static_configs:
- targets: ['<IP>:8080']
Jenkins and plugins versions report
Environment
``` Jenkins version - Jenkins 2.346.3 Prometheus plugin Version - 2.0.11 We are jenkins over a pod. Installed plugins jacoco: 2.2.1 greenballs: 1.15.1 popper2-api: 2.11.5-2 jquery-detached: 1.2.1 gradle: 1.38 cloudbees-folder: 6.722.v8165b_a_cf25e9 ws-cleanup: 0.42 durable-task: 496.va67c6f9eefa7 gitlab-plugin: 1.5.35 plain-credentials: 1.8 pipeline-stage-view: 2.24 blueocean-commons: 1.25.5 metrics: 4.1.6.2 rebuild: 1.34 blueocean-pipeline-api-impl: 1.25.5 cobertura: 1.17 cloudbees-disk-usage-simple: 0.10 htmlpublisher: 1.30 embeddable-build-status: 237.v37e2c03964c9 jobConfigHistory: 1165.v8cc9fd1f4597 handy-uri-templates-2-api: 2.1.8-22.v77d5b_75e6953 discard-old-build: 1.05 badge: 1.9.1 pipeline-utility-steps: 2.12.1 forensics-api: 1.13.0 github: 1.34.3 ant: 475.vf34069fef73c bouncycastle-api: 2.26 kubernetes-credentials: 0.9.0 maven-plugin: 3.19 blueocean-dashboard: 1.25.5 workflow-job: 1182.v60a_e6279b_579 aws-java-sdk-logs: 1.12.215-339.vdc07efc5320c config-file-provider: 3.10.0 blueocean-i18n: 1.25.5 job-dsl: 1.79 pipeline-model-api: 2.2086.v12b_420f036e5 workflow-step-api: 639.v6eca_cd8c04a_a_ warnings-ng: 9.12.0 timestamper: 1.17 blueocean-bitbucket-pipeline: 1.25.5 jersey2-api: 2.36-2 kubernetes-client-api: 5.12.2-193.v26a_6078f65a_9 code-coverage-api: 2.0.4 workflow-aggregator: 581.v0c46fa_697ffd ldap: 2.10 blueocean-jira: 1.25.5 aws-java-sdk-codebuild: 1.12.215-339.vdc07efc5320c crowd2: 3.1.2 pretested-integration: 3.1.2 pipeline-model-declarative-agent: 1.1.1 docker-commons: 1.19 authentication-tokens: 1.4 blueocean-github-pipeline: 1.25.5 build-timestamp: 1.0.3 configuration-as-code: 1512.vb_79d418d5fc8 pipeline-model-extensions: 2.2086.v12b_420f036e5 blueocean-display-url: 2.4.1 okhttp-api: 4.9.3-105.vb96869f8ac3a pipeline-stage-tags-metadata: 2.2086.v12b_420f036e5 plugin-util-api: 2.17.0 job-restrictions: 0.8 build-user-vars-plugin: 1.8 aws-java-sdk-ecs: 1.12.215-339.vdc07efc5320c blueocean-config: 1.25.5 echarts-api: 5.3.2-2 workflow-multibranch: 716.vc692a_e52371b_ javax-mail-api: 1.6.2-7 throttle-concurrents: 2.8 aws-java-sdk-ssm: 1.12.215-339.vdc07efc5320c cloudbees-bitbucket-branch-source: 773.v4b_9b_005b_562b_ aws-java-sdk: 1.12.215-339.vdc07efc5320c custom-job-icon: 0.2 blueocean-rest: 1.25.5 apache-httpcomponents-client-4-api: 4.5.13-1.0 copyartifact: 1.46.4 ssh-credentials: 277.v95c2fec1c047 matrix-project: 771.v574584b_39e60 data-tables-api: 1.11.4-4 ssh-slaves: 1.814.vc82988f54b_10 bootstrap4-api: 4.6.0-5 analysis-model-api: 10.10.1 blueocean-web: 1.25.5 run-condition: 1.5 variant: 1.4 blueocean-pipeline-editor: 1.25.5 lockable-resources: 2.15 workflow-support: 820.vd1a_6cc65ef33 periodicbackup: 1.8 branch-api: 2.1046.v0ca_37783ecc5 jaxb: 2.3.6-1 aws-java-sdk-iam: 1.12.215-339.vdc07efc5320c display-url-api: 2.3.6 conditional-buildstep: 1.4.2 envinject-api: 1.199.v3ce31253ed13 popper-api: 1.16.1-3 github-autostatus: 3.6.2 aws-java-sdk-minimal: 1.12.215-339.vdc07efc5320c momentjs: 1.1.1 blueocean-personalization: 1.25.5 ace-editor: 1.1 saml: 2.298.vc7a_2b_3958628 pipeline-groovy-lib: 589.vb_a_b_4a_a_8c443c aws-java-sdk-elasticbeanstalk: 1.12.215-339.vdc07efc5320c workflow-durable-task-step: 1139.v252a_e12e8463 workflow-cps-global-lib: 588.v576c103a_ff86 javax-activation-api: 1.2.0-4 pipeline-stage-step: 293.v200037eefcd5 extended-read-permission: 3.2 allure-jenkins-plugin: 2.30.2 favorite: 2.4.1 token-macro: 293.v283932a_0a_b_49 docker-workflow: 1.28 blueocean-jwt: 1.25.5 external-monitor-job: 192.ve979ca_8b_3ccd aws-java-sdk-ec2: 1.12.215-339.vdc07efc5320c git-client: 3.11.2 blueocean-events: 1.25.5 aws-java-sdk-ecr: 1.12.215-339.vdc07efc5320c git-server: 1.11 ivy: 2.2 blueocean-rest-impl: 1.25.5 jsch: 0.1.55.2 checks-api: 1.7.4 rocketchatnotifier: 1.4.10 blueocean-pipeline-scm-api: 1.25.5 javadoc: 217.v905b_86277a_2a_ kubernetes: 3600.v144b_cd192ca_a_ structs: 318.va_f3ccb_729b_71 artifactory: 3.16.2 caffeine-api: 2.9.3-65.v6a_47d0f4d1fe pipeline-rest-api: 2.24 blueocean-autofavorite: 1.2.5 git: 4.11.4 matrix-auth: 3.1.2 mercurial: 2.16.2 handlebars: 3.0.8 antisamy-markup-formatter: 2.7 jdk-tool: 1.5 workflow-scm-step: 400.v6b_89a_1317c9a_ prometheus: 2.0.11 pipeline-milestone-step: 101.vd572fef9d926 github-branch-source: 1637.vd833b_7ca_7654 snakeyaml-api: 1.30.2-76.vc104f7ce9870 pipeline-build-step: 2.18 pipeline-input-step: 449.v77f0e8b_845c4 aws-secrets-manager-credentials-provider: 1.1.0 trilead-api: 1.57.v6e90e07157e1 aws-java-sdk-cloudformation: 1.12.215-339.vdc07efc5320c font-awesome-api: 6.1.1-1 next-build-number: 1.8 role-strategy: 488.v0634ce149b_8c workflow-api: 1153.vb_912c0e47fb_a_ jackson2-api: 2.13.3-285.vc03c0256d517 prism-api: 1.26.0-2 build-name-setter: 2.2.0 blueocean-git-pipeline: 1.25.5 sshd: 3.237.v883d165a_c1d3 uno-choice: 2.6.3 github-api: 1.303-400.v35c2d8258028 ssh-agent: 295.v9ca_a_1c7cc3a_a_ sse-gateway: 1.25 ansicolor: 1.0.1 script-security: 1175.v4b_d517d6db_f0 jquery3-api: 3.6.0-3 jenkins-design-language: 1.25.5 mailer: 414.vcc4c33714601 scm-api: 608.vfa_f971c5a_a_e9 pipeline-model-definition: 2.2086.v12b_420f036e5 junit: 1119.1121.vc43d0fc45561 bootstrap5-api: 5.2.0-1 text-finder: 1.19 email-ext: 2.88 monitoring: 1.91.0 xvfb: 1.2 aws-credentials: 191.vcb_f183ce58b_9 jira: 3.7.1 pipeline-graph-analysis: 195.v5812d95a_a_2f9 jjwt-api: 0.11.5-77.v646c772fddb_0 workflow-basic-steps: 948.v2c72a_091b_b_68 envinject: 2.866.v5c0403e3d4df windows-slaves: 1.8.1 pubsub-light: 1.16 credentials-binding: 523.vd859a_4b_122e6 gerrit-trigger: 2.36.0 resource-disposer: 0.19 blueocean: 1.25.5 command-launcher: 84.v4a_97f2027398 permissive-script-security: 0.7 parameterized-trigger: 2.44 credentials: 1139.veb_9579fca_33b_ workflow-cps: 2706.v71dd22b_c5a_a_2 blueocean-core-js: 1.25.5 ```What Operating System are you using (both controller, and any agents involved in the problem)?
we have used docker image with version 2.346.3, running on kuberenetes
Reproduction steps
After installing plugin successfully, we tried accessing https://Jenkins_url/prometheus, it does not show up anything in the browser.
Expected Results
when we access https://Jenkins_url/prometheus it show metrics related Jenkins
Actual Results
metrics are not shown in browser screen
Anything else?
No response