Skip to content

Commit 64b6ac4

Browse files
authored
Revert "feat(telemetry): centralize konflux telemetry configuration in commonlib"
1 parent 1269122 commit 64b6ac4

File tree

4 files changed

+21
-14
lines changed

4 files changed

+21
-14
lines changed

jobs/build/build-sync-konflux/Jenkinsfile

Lines changed: 9 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,8 @@ node() {
3838
commonlib.mockParam(),
3939
commonlib.ocpVersionParam('BUILD_VERSION', '4'),
4040
commonlib.artToolsParam(),
41+
commonlib.enableTelemetryParam(),
42+
commonlib.telemetryEndpointParam(),
4143
string(
4244
name: 'ASSEMBLY',
4345
description: 'The name of an assembly to sync.',
@@ -106,8 +108,6 @@ node() {
106108
description : 'WARNING: Only enable this if a payload containing embargoed build(s) is being promoted after embargo lift',
107109
defaultValue: false,
108110
),
109-
commonlib.enableTelemetryParam(),
110-
commonlib.telemetryEndpointParam(),
111111
],
112112
]
113113
]) // Please update README.md if modifying parameter names or semantics
@@ -164,6 +164,12 @@ node() {
164164
if (params.DRY_RUN) {
165165
cmd << "--dry-run"
166166
}
167+
if (params.TELEMETRY_ENABLED) {
168+
env.TELEMETRY_ENABLED = "1"
169+
if (params.OTEL_EXPORTER_OTLP_ENDPOINT && params.OTEL_EXPORTER_OTLP_ENDPOINT != "") {
170+
env.OTEL_EXPORTER_OTLP_ENDPOINT = params.OTEL_EXPORTER_OTLP_ENDPOINT
171+
}
172+
}
167173
cmd += [
168174
"build-sync",
169175
"--version=${params.BUILD_VERSION}",
@@ -210,14 +216,7 @@ node() {
210216
file(credentialsId: 'konflux-gcp-app-creds-prod', variable: 'GOOGLE_APPLICATION_CREDENTIALS'),
211217
file(credentialsId: 'konflux-art-images-auth-file', variable: 'KONFLUX_ART_IMAGES_AUTH_FILE'),
212218
]) {
213-
def envVars = ["BUILD_URL=${BUILD_URL}", "JOB_NAME=${JOB_NAME}"]
214-
if (params.TELEMETRY_ENABLED) {
215-
envVars << "TELEMETRY_ENABLED=1"
216-
if (params.OTEL_EXPORTER_OTLP_ENDPOINT && params.OTEL_EXPORTER_OTLP_ENDPOINT != "") {
217-
envVars << "OTEL_EXPORTER_OTLP_ENDPOINT=${params.OTEL_EXPORTER_OTLP_ENDPOINT}"
218-
}
219-
}
220-
withEnv(envVars) {
219+
withEnv(["BUILD_URL=${BUILD_URL}", "JOB_NAME=${JOB_NAME}"]) {
221220
sh(script: cmd.join(' '), returnStdout: true)
222221
}
223222
}

jobs/build/build-sync/Jenkinsfile

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,8 @@ node() {
3838
commonlib.mockParam(),
3939
commonlib.ocpVersionParam('BUILD_VERSION', '4'),
4040
commonlib.artToolsParam(),
41+
commonlib.enableTelemetryParam(),
42+
commonlib.telemetryEndpointParam(),
4143
string(
4244
name: 'ASSEMBLY',
4345
description: 'The name of an assembly to sync.',
@@ -168,6 +170,12 @@ node() {
168170
if (params.DRY_RUN) {
169171
cmd << "--dry-run"
170172
}
173+
if (params.TELEMETRY_ENABLED) {
174+
env.TELEMETRY_ENABLED = "1"
175+
if (params.OTEL_EXPORTER_OTLP_ENDPOINT && params.OTEL_EXPORTER_OTLP_ENDPOINT != "") {
176+
env.OTEL_EXPORTER_OTLP_ENDPOINT = params.OTEL_EXPORTER_OTLP_ENDPOINT
177+
}
178+
}
171179
cmd += [
172180
"build-sync",
173181
"--version=${params.BUILD_VERSION}",

jobs/build/ocp4-konflux/Jenkinsfile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -118,8 +118,8 @@ node {
118118
description: '(For testing) Skip the OLM bundle build step',
119119
defaultValue: false, // Default to true until we believe bundle build is stable.
120120
),
121-
commonlib.enableTelemetryParam(),
122-
commonlib.telemetryEndpointParam(),
121+
commonlib.enableTelemetryParam() + [defaultValue: true],
122+
commonlib.telemetryEndpointParam() + [defaultValue: 'http://internal-a344ed20604f143d7955b3c06c517eb8-1688607883.us-east-1.elb.amazonaws.com:4317'],
123123
]
124124
],
125125
]

pipeline-scripts/commonlib.groovy

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -125,7 +125,7 @@ def enableTelemetryParam() {
125125
name: 'TELEMETRY_ENABLED',
126126
description: 'Enable or disable sending traces to otel',
127127
$class: 'BooleanParameterDefinition',
128-
defaultValue: true
128+
defaultValue: false
129129
]
130130
}
131131

@@ -134,7 +134,7 @@ def telemetryEndpointParam() {
134134
name: 'OTEL_EXPORTER_OTLP_ENDPOINT',
135135
description: 'A base endpoint URL for any signal type, with an optionally-specified port number. Helpful for when you’re sending more than one signal to the same endpoint and want one environment variable to control the endpoint',
136136
$class: 'hudson.model.StringParameterDefinition',
137-
defaultValue: 'http://internal-a344ed20604f143d7955b3c06c517eb8-1688607883.us-east-1.elb.amazonaws.com:4317'
137+
defaultValue: ''
138138
]
139139
}
140140

0 commit comments

Comments
 (0)