Skip to content

Commit

Permalink
Update Jenkins detector (#34)
Browse files Browse the repository at this point in the history
  • Loading branch information
krzko committed Jul 18, 2022
1 parent 064f90a commit 8250bcb
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
2 changes: 1 addition & 1 deletion library/otel_traces_detector.sh
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,6 @@ if [ ${DEPLOYMENT_ID-} ]; then
fi

# Jenkins
if [ ${JENKINS_URL-} ]; then
if [ ${CI-} ] && [ ${JENKINS_URL-} ]; then
. "${OTEL_SH_LIB_PATH}/otel_traces_detector_jenkins.sh"
fi
4 changes: 4 additions & 0 deletions library/otel_traces_detector_jenkins.sh
Original file line number Diff line number Diff line change
Expand Up @@ -19,11 +19,15 @@
log_info "Detected, Jenkins pipeline"

detector_resource_attributes=(
"jenkins.branch.name:${BRANCH_NAME}"
"jenkins.build.id:${BUILD_ID}"
"jenkins.build.number:${BUILD_NUMBER}"
"jenkins.build.tag:${BUILD_TAG}"
"jenkins.build.url:${BUILD_URL}"
"jenkins.change.author:${CHANGE_AUTHOR}"
"jenkins.executor.number:${EXECUTOR_NUMBER}"
"jenkins.git.branch:${GIT_BRANCH}"
"jenkins.git.commit:${GIT_COMMIT}"
"jenkins.hostname:${HOSTNAME}"
"jenkins.java.home:${JAVA_HOME}"
"jenkins.job.name:${JOB_NAME}"
Expand Down

0 comments on commit 8250bcb

Please sign in to comment.