jenkinsci / prometheus-plugin

Jenkins Prometheus Plugin
https://plugins.jenkins.io/prometheus/
Apache License 2.0
184 stars 152 forks source link

Cant change prometheus endpoint using ENV #236

Closed bashbers closed 3 years ago

bashbers commented 3 years ago

Version report

Jenkins and plugins versions report:

Jenkins: 2.249.2
OS: Linux - 3.10.0-957.12.2.el7.x86_64
---
ace-editor:1.1
blueocean-i18n:1.24.3
crowd2:2.0.2
bouncycastle-api:2.18
ant:1.11
blueocean:1.24.3
blueocean-personalization:1.24.3
antisamy-markup-formatter:1.1
favorite:2.3.2
apache-httpcomponents-client-4-api:4.5.10-2.0
blueocean-display-url:2.4.0
branch-api:2.6.2
git:4.4.5
artifactory:3.9.0
blueocean-pipeline-api-impl:1.24.3
authentication-tokens:1.4
blueocean-jira:1.24.3
github:1.32.0
basic-branch-build-strategies:1.3.2
blueocean-git-pipeline:1.24.3
gradle:1.36
ivy:2.1
blueocean-pipeline-editor:1.24.3
blueocean-autofavorite:1.2.4
blueocean-jwt:1.24.3
javadoc:1.6
blueocean-bitbucket-pipeline:1.24.3
checks-api:1.1.1
blueocean-commons:1.24.3
blueocean-pipeline-scm-api:1.24.3
bootstrap4-api:4.5.3-1
blueocean-config:1.24.3
blueocean-rest-impl:1.24.3
blueocean-github-pipeline:1.24.3
blueocean-core-js:1.24.3
blueocean-rest:1.24.3
blueocean-dashboard:1.24.3
blueocean-events:1.24.3
blueocean-web:1.24.3
jdk-tool:1.0
cloudbees-bitbucket-branch-source:2.9.4
github-branch-source:2.9.1
github-api:1.116
cloudbees-folder:6.15
docker-workflow:1.25
htmlpublisher:1.23
command-launcher:1.2
git-client:3.5.1
config-file-provider:3.7.0
jira:3.1.3
copyartifact:1.45.2
external-monitor-job:1.4
credentials-binding:1.24
job-dsl:1.77
credentials:2.3.14
git-server:1.9
google-oauth-plugin:1.0.2
font-awesome-api:5.15.1-1
jsch:0.1.55.2
greenballs:1.15
cucumber-reports:5.4.0
durable-task:1.35
http_request:1.8.27
deployit-plugin:7.5.8
junit:1.44
display-url-api:2.3.4
handlebars:1.1.1
docker-commons:1.17
echarts-api:4.9.0-2
kubernetes-client-api:4.11.1
scm-api:2.6.4
kubernetes-credentials-provider:1.0.21
okhttp-api:3.14.9
kubernetes-credentials:0.7.0
handy-uri-templates-2-api:2.1.8-1.0
jquery3-api:3.5.1-2
hashicorp-vault-plugin:3.6.1
ldap:1.11
popper-api:1.16.0-7
pam-auth:1.5.1
sonar:2.12
hp-application-automation-tools-plugin:6.4
structs:1.22
plugin-util-api:1.4.0
mailer:1.32.1
variant:1.3
locale:1.4
pubsub-light:1.13
maven-plugin:3.8
jackson2-api:2.12.1
matrix-auth:2.6.4
jenkins-design-language:1.24.3
lockable-resources:2.10
mercurial:2.12
momentjs:1.1.1
job-fan-in:1.1.4
jquery-detached:1.2.1
matrix-project:1.18
oauth-credentials:0.4
kubernetes:1.27.5
role-strategy:3.1
plain-credentials:1.7
pipeline-stage-view:2.18
metrics:4.0.2.7
parameterized-scheduler:0.9.2
pipeline-stage-step:2.5
script-security:1.76
pipeline-build-step:2.13
service-now:0.0.4
pipeline-graph-analysis:1.10
pipeline-input-step:2.12
pipeline-milestone-step:1.3.1
pipeline-model-api:1.7.2
pipeline-utility-steps:2.6.1
pipeline-model-declarative-agent:1.1.1
pipeline-model-definition:1.7.2
run-condition:1.3
pipeline-stage-tags-metadata:1.7.2
pipeline-model-extensions:1.7.2
snakeyaml-api:1.27.0
pipeline-rest-api:2.18
sse-gateway:1.24
extended-read-permission:3.2
workflow-scm-step:2.11
ssh-agent:1.20
ssh-credentials:1.18.1
timestamper:1.11.8
workflow-step-api:2.23
token-macro:2.12
trilead-api:1.0.12
prometheus:2.0.9
workflow-support:3.8
windows-slaves:1.0
workflow-aggregator:2.6
workflow-multibranch:2.22
workflow-api:2.42
workflow-basic-steps:2.22
ssh-steps:2.0.0
workflow-cps-global-lib:2.17
workflow-cps:2.85
cloudbees-disk-usage-simple:0.10
workflow-durable-task-step:2.36
workflow-job:2.40
https://hub.docker.com/layers/jenkins/jenkins/2.249.2-lts/images/sha256-aa1ec2a6a106608a286dc06c334053fced1df87a7cb307853ca1cf8fa48ba09b?context=explore

Reproduction steps

Results

Expected result:

To have a /metrics endpoint.

Actual result:

No reachable endpoint.

bashbers commented 3 years ago

Seems related to #73

afbeelding It seems to set the ENV correctly, but it gives a warning about having set an ENV variable which will override the given parameter.


It doesnt seem to set the default_namespace, eventhough Ive added the following to my statefulset:

statefulset.yaml

name: PROMETHEUS_NAMESPACE
              valueFrom:
                configMapKeyRef:
                  name: global-variables
                  key: PROMETHEUS_NAMESPACE

global-variables.yaml PROMETHEUS_NAMESPACE: 'jenkins2-acc'

markjacksonfishing commented 3 years ago

This cannot be changed

bashbers commented 3 years ago

This cannot be changed

Do you mean that the default namespace jenkins cant be renamed?. https://github.com/jenkinsci/prometheus-plugin#environment-variables

markjacksonfishing commented 3 years ago

Correct