jenkinsci/opentelemetry-plugin

Setting up OT trough environment variables does not work

jcampalo opened this issue · 1 comments

Jenkins and plugins versions report

Environment ``` Jenkins: 2.375.3 OS: Linux - 5.10.186-179.751.amzn2.x86_64 Java: 17.0.6 - Eclipse Adoptium (OpenJDK 64-Bit Server VM) --- apache-httpcomponents-client-4-api:4.5.14-150.v7a_b_9d17134a_5 bootstrap5-api:5.2.1-3 bouncycastle-api:2.29 branch-api:2.1105.v472604208c55 build-timeout:1.28 caffeine-api:3.1.8-133.v17b_1ff2e0599 checks-api:1.8.1 cloudbees-folder:6.815.v0dd5a_cb_40e0e command-launcher:1.2 commons-lang3-api:3.13.0-62.v7d18e55f51e2 commons-text-api:1.10.0-68.v0d0b_c439292b_ credentials:1224.vc23ca_a_9a_2cb_0 credentials-binding:626.v8d9034b_8ea_cc dashboard-view:2.495.v07e81500c3f2 display-url-api:2.200.vb_9327d658781 durable-task:523.va_a_22cf15d5e0 echarts-api:5.4.0-1 font-awesome-api:6.2.1-1 git:5.0.2 git-client:4.3.0 global-post-script:1.1.4 groovy:457.v99900cb_85593 instance-identity:173.va_37c494ec4e5 ionicons-api:56.v1b_1c8c49374e jackson2-api:2.15.3-363.v82c51b_de9f60 jakarta-activation-api:2.0.1-3 jakarta-mail-api:2.0.1-3 javax-activation-api:1.2.0-6 javax-mail-api:1.6.2-5 jaxb:2.3.8-1 jdk-tool:1.0 job-dsl:1.82 jquery3-api:3.6.1-2 junit:1202.v79a_986785076 ldap:711.vb_d1a_491714dc mailer:457.v3f72cb_e015e5 matrix-auth:3.1.9 mina-sshd-api-common:2.11.0-86.v836f585d47fa_ mina-sshd-api-core:2.11.0-86.v836f585d47fa_ okhttp-api:4.11.0-145.vcb_8de402ef81 opentelemetry:2.17.0 pipeline-build-step:491.v1fec530da_858 pipeline-groovy-lib:689.veec561a_dee13 pipeline-input-step:477.v339683a_8d55e pipeline-model-api:2.2133.ve46a_6113dfc3 pipeline-model-definition:2.2133.ve46a_6113dfc3 pipeline-model-extensions:2.2133.ve46a_6113dfc3 pipeline-stage-step:305.ve96d0205c1c6 pipeline-stage-tags-metadata:2.2133.ve46a_6113dfc3 plain-credentials:143.v1b_df8b_d3b_e48 plugin-util-api:2.20.0 popper2-api:2.11.6-2 scm-api:676.v886669a_199a_a_ script-security:1269.v639888f5e366 slack:684.v833089650554 snakeyaml-api:2.2-111.vc6598e30cc65 ssh-credentials:305.v8f4381501156 sshd:3.236.ved5e1b_cb_50b_2 structs:325.vcb_307d2a_2782 token-macro:359.vb_cde11682e0c trilead-api:2.84.v72119de229b_7 variant:60.v7290fc0eb_b_cd workflow-api:1283.v99c10937efcb_ workflow-basic-steps:1042.ve7b_140c4a_e0c workflow-cps:3673.v5b_dd74276262 workflow-durable-task-step:1289.v4d3e7b_01546b_ workflow-job:1326.ve643e00e9220 workflow-multibranch:746.v05814d19c001 workflow-scm-step:408.v7d5b_135a_b_d49 workflow-step-api:639.v6eca_cd8c04a_a_ workflow-support:839.v35e2736cfd5c ```

What Operating System are you using (both controller and any agents involved in the problem)?

Linux

Reproduction steps

Monitor Jenkins using OT and NR:

  1. Set OTEL_EXPORTER_OTLP_ENDPOINT="https://otlp.nr-data.net:4317" environment variable.
  2. Set OTEL_EXPORTER_OTLP_HEADERS="api-key=..." environment variable.
  3. Start jenkins.

Expected Results

The plugin reports to the OT endpoint and I can see the data in NR.

Actual Results

No data is reported to the OT endpoint and no data is visible in NR.

Anything else?

I failed to configure with environment variables, but if done trough the UI instead it worked without any problem.

The plugin cannot be configured solely with OTEL_EXPORTER_ environment variables. It requires additional information that is not provided by those variables, such as the backend type and other details. The plugin can be configured using Jenkins Configuration as Code or through the UI. It would be difficult to configure it only with those only inputs so I will close the issue because the feature will not be implemented.