Skip to content

Commit b49b13b

Browse files
authored
update: Tracing is enabled by default (#2347)
Signed-off-by: Viet Nguyen Duc <[email protected]>
1 parent 821eff3 commit b49b13b

15 files changed

+97
-16
lines changed

Diff for: Base/Dockerfile

+4
Original file line numberDiff line numberDiff line change
@@ -159,6 +159,10 @@ ENV SE_BIND_HOST=false \
159159
SE_OTEL_JAVA_GLOBAL_AUTOCONFIGURE_ENABLED=true \
160160
SE_OTEL_TRACES_EXPORTER="otlp" \
161161
SE_SUPERVISORD_LOG_LEVEL="info" \
162+
SE_LOG_LEVEL="INFO" \
163+
SE_HTTP_LOGS=false \
164+
SE_STRUCTURED_LOGS=false \
165+
SE_ENABLE_TRACING=true \
162166
SE_ENABLE_TLS=false \
163167
SE_JAVA_SSL_TRUST_STORE="/opt/selenium/secrets/server.jks" \
164168
SE_JAVA_SSL_TRUST_STORE_PASSWORD="/opt/selenium/secrets/server.pass" \

Diff for: Distributor/start-selenium-grid-distributor.sh

+7
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,11 @@ if [ ! -z "$SE_LOG_LEVEL" ]; then
5959
SE_OPTS="$SE_OPTS --log-level ${SE_LOG_LEVEL}"
6060
fi
6161

62+
if [ ! -z "$SE_HTTP_LOGS" ]; then
63+
echo "Appending Selenium options: --http-logs ${SE_HTTP_LOGS}"
64+
SE_OPTS="$SE_OPTS --http-logs ${SE_HTTP_LOGS}"
65+
fi
66+
6267
if [ ! -z "$SE_STRUCTURED_LOGS" ]; then
6368
echo "Appending Selenium options: --structured-logs ${SE_STRUCTURED_LOGS}"
6469
SE_OPTS="$SE_OPTS --structured-logs ${SE_STRUCTURED_LOGS}"
@@ -136,6 +141,8 @@ if [ "$SE_ENABLE_TRACING" = "true" ]; then
136141
SE_JAVA_OPTS="$SE_JAVA_OPTS ${SE_OTEL_JVM_ARGS}"
137142
fi
138143
else
144+
SE_OPTS="$SE_OPTS --tracing false"
145+
SE_JAVA_OPTS="$SE_JAVA_OPTS -Dwebdriver.remote.enableTracing=false"
139146
echo "Tracing is disabled"
140147
fi
141148

Diff for: EventBus/start-selenium-grid-eventbus.sh

+7
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,11 @@ if [ ! -z "$SE_LOG_LEVEL" ]; then
2424
SE_OPTS="$SE_OPTS --log-level ${SE_LOG_LEVEL}"
2525
fi
2626

27+
if [ ! -z "$SE_HTTP_LOGS" ]; then
28+
echo "Appending Selenium options: --http-logs ${SE_HTTP_LOGS}"
29+
SE_OPTS="$SE_OPTS --http-logs ${SE_HTTP_LOGS}"
30+
fi
31+
2732
if [ ! -z "$SE_STRUCTURED_LOGS" ]; then
2833
echo "Appending Selenium options: --structured-logs ${SE_STRUCTURED_LOGS}"
2934
SE_OPTS="$SE_OPTS --structured-logs ${SE_STRUCTURED_LOGS}"
@@ -86,6 +91,8 @@ if [ "$SE_ENABLE_TRACING" = "true" ]; then
8691
SE_JAVA_OPTS="$SE_JAVA_OPTS ${SE_OTEL_JVM_ARGS}"
8792
fi
8893
else
94+
SE_OPTS="$SE_OPTS --tracing false"
95+
SE_JAVA_OPTS="$SE_JAVA_OPTS -Dwebdriver.remote.enableTracing=false"
8996
echo "Tracing is disabled"
9097
fi
9198

Diff for: Hub/start-selenium-grid-hub.sh

+7
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,11 @@ if [ ! -z "$SE_LOG_LEVEL" ]; then
2727
SE_OPTS="$SE_OPTS --log-level ${SE_LOG_LEVEL}"
2828
fi
2929

30+
if [ ! -z "$SE_HTTP_LOGS" ]; then
31+
echo "Appending Selenium options: --http-logs ${SE_HTTP_LOGS}"
32+
SE_OPTS="$SE_OPTS --http-logs ${SE_HTTP_LOGS}"
33+
fi
34+
3035
if [ ! -z "$SE_STRUCTURED_LOGS" ]; then
3136
echo "Appending Selenium options: --structured-logs ${SE_STRUCTURED_LOGS}"
3237
SE_OPTS="$SE_OPTS --structured-logs ${SE_STRUCTURED_LOGS}"
@@ -119,6 +124,8 @@ if [ "$SE_ENABLE_TRACING" = "true" ]; then
119124
SE_JAVA_OPTS="$SE_JAVA_OPTS ${SE_OTEL_JVM_ARGS}"
120125
fi
121126
else
127+
SE_OPTS="$SE_OPTS --tracing false"
128+
SE_JAVA_OPTS="$SE_JAVA_OPTS -Dwebdriver.remote.enableTracing=false"
122129
echo "Tracing is disabled"
123130
fi
124131

Diff for: NodeBase/start-selenium-node.sh

+7
Original file line numberDiff line numberDiff line change
@@ -66,6 +66,11 @@ if [ ! -z "$SE_LOG_LEVEL" ]; then
6666
SE_OPTS="$SE_OPTS --log-level ${SE_LOG_LEVEL}"
6767
fi
6868

69+
if [ ! -z "$SE_HTTP_LOGS" ]; then
70+
echo "Appending Selenium options: --http-logs ${SE_HTTP_LOGS}"
71+
SE_OPTS="$SE_OPTS --http-logs ${SE_HTTP_LOGS}"
72+
fi
73+
6974
if [ ! -z "$SE_STRUCTURED_LOGS" ]; then
7075
echo "Appending Selenium options: --structured-logs ${SE_STRUCTURED_LOGS}"
7176
SE_OPTS="$SE_OPTS --structured-logs ${SE_STRUCTURED_LOGS}"
@@ -139,6 +144,8 @@ if [ "$SE_ENABLE_TRACING" = "true" ]; then
139144
SE_JAVA_OPTS="$SE_JAVA_OPTS ${SE_OTEL_JVM_ARGS}"
140145
fi
141146
else
147+
SE_OPTS="$SE_OPTS --tracing false"
148+
SE_JAVA_OPTS="$SE_JAVA_OPTS -Dwebdriver.remote.enableTracing=false"
142149
echo "Tracing is disabled"
143150
fi
144151

Diff for: NodeDocker/start-selenium-grid-docker.sh

+7
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,11 @@ if [ ! -z "$SE_LOG_LEVEL" ]; then
3434
SE_OPTS="$SE_OPTS --log-level ${SE_LOG_LEVEL}"
3535
fi
3636

37+
if [ ! -z "$SE_HTTP_LOGS" ]; then
38+
echo "Appending Selenium options: --http-logs ${SE_HTTP_LOGS}"
39+
SE_OPTS="$SE_OPTS --http-logs ${SE_HTTP_LOGS}"
40+
fi
41+
3742
if [ ! -z "$SE_STRUCTURED_LOGS" ]; then
3843
echo "Appending Selenium options: --structured-logs ${SE_STRUCTURED_LOGS}"
3944
SE_OPTS="$SE_OPTS --structured-logs ${SE_STRUCTURED_LOGS}"
@@ -96,6 +101,8 @@ if [ "$SE_ENABLE_TRACING" = "true" ]; then
96101
SE_JAVA_OPTS="$SE_JAVA_OPTS ${SE_OTEL_JVM_ARGS}"
97102
fi
98103
else
104+
SE_OPTS="$SE_OPTS --tracing false"
105+
SE_JAVA_OPTS="$SE_JAVA_OPTS -Dwebdriver.remote.enableTracing=false"
99106
echo "Tracing is disabled"
100107
fi
101108

Diff for: Router/start-selenium-grid-router.sh

+7
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,11 @@ if [ ! -z "$SE_LOG_LEVEL" ]; then
5959
SE_OPTS="$SE_OPTS --log-level ${SE_LOG_LEVEL}"
6060
fi
6161

62+
if [ ! -z "$SE_HTTP_LOGS" ]; then
63+
echo "Appending Selenium options: --http-logs ${SE_HTTP_LOGS}"
64+
SE_OPTS="$SE_OPTS --http-logs ${SE_HTTP_LOGS}"
65+
fi
66+
6267
if [ ! -z "$SE_STRUCTURED_LOGS" ]; then
6368
echo "Appending Selenium options: --structured-logs ${SE_STRUCTURED_LOGS}"
6469
SE_OPTS="$SE_OPTS --structured-logs ${SE_STRUCTURED_LOGS}"
@@ -141,6 +146,8 @@ if [ "$SE_ENABLE_TRACING" = "true" ]; then
141146
SE_JAVA_OPTS="$SE_JAVA_OPTS ${SE_OTEL_JVM_ARGS}"
142147
fi
143148
else
149+
SE_OPTS="$SE_OPTS --tracing false"
150+
SE_JAVA_OPTS="$SE_JAVA_OPTS -Dwebdriver.remote.enableTracing=false"
144151
echo "Tracing is disabled"
145152
fi
146153

Diff for: SessionQueue/start-selenium-grid-session-queue.sh

+7
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,11 @@ if [ ! -z "$SE_LOG_LEVEL" ]; then
2424
SE_OPTS="$SE_OPTS --log-level ${SE_LOG_LEVEL}"
2525
fi
2626

27+
if [ ! -z "$SE_HTTP_LOGS" ]; then
28+
echo "Appending Selenium options: --http-logs ${SE_HTTP_LOGS}"
29+
SE_OPTS="$SE_OPTS --http-logs ${SE_HTTP_LOGS}"
30+
fi
31+
2732
if [ ! -z "$SE_STRUCTURED_LOGS" ]; then
2833
echo "Appending Selenium options: --structured-logs ${SE_STRUCTURED_LOGS}"
2934
SE_OPTS="$SE_OPTS --structured-logs ${SE_STRUCTURED_LOGS}"
@@ -91,6 +96,8 @@ if [ "$SE_ENABLE_TRACING" = "true" ]; then
9196
SE_JAVA_OPTS="$SE_JAVA_OPTS ${SE_OTEL_JVM_ARGS}"
9297
fi
9398
else
99+
SE_OPTS="$SE_OPTS --tracing false"
100+
SE_JAVA_OPTS="$SE_JAVA_OPTS -Dwebdriver.remote.enableTracing=false"
94101
echo "Tracing is disabled"
95102
fi
96103

Diff for: Sessions/start-selenium-grid-sessions.sh

+7
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,11 @@ if [ ! -z "$SE_LOG_LEVEL" ]; then
3939
SE_OPTS="$SE_OPTS --log-level ${SE_LOG_LEVEL}"
4040
fi
4141

42+
if [ ! -z "$SE_HTTP_LOGS" ]; then
43+
echo "Appending Selenium options: --http-logs ${SE_HTTP_LOGS}"
44+
SE_OPTS="$SE_OPTS --http-logs ${SE_HTTP_LOGS}"
45+
fi
46+
4247
if [ ! -z "$SE_STRUCTURED_LOGS" ]; then
4348
echo "Appending Selenium options: --structured-logs ${SE_STRUCTURED_LOGS}"
4449
SE_OPTS="$SE_OPTS --structured-logs ${SE_STRUCTURED_LOGS}"
@@ -106,6 +111,8 @@ if [ "$SE_ENABLE_TRACING" = "true" ]; then
106111
SE_JAVA_OPTS="$SE_JAVA_OPTS ${SE_OTEL_JVM_ARGS}"
107112
fi
108113
else
114+
SE_OPTS="$SE_OPTS --tracing false"
115+
SE_JAVA_OPTS="$SE_JAVA_OPTS -Dwebdriver.remote.enableTracing=false"
109116
echo "Tracing is disabled"
110117
fi
111118

Diff for: Standalone/start-selenium-standalone.sh

+7
Original file line numberDiff line numberDiff line change
@@ -66,6 +66,11 @@ if [ ! -z "$SE_LOG_LEVEL" ]; then
6666
SE_OPTS="$SE_OPTS --log-level ${SE_LOG_LEVEL}"
6767
fi
6868

69+
if [ ! -z "$SE_HTTP_LOGS" ]; then
70+
echo "Appending Selenium options: --http-logs ${SE_HTTP_LOGS}"
71+
SE_OPTS="$SE_OPTS --http-logs ${SE_HTTP_LOGS}"
72+
fi
73+
6974
if [ ! -z "$SE_STRUCTURED_LOGS" ]; then
7075
echo "Appending Selenium options: --structured-logs ${SE_STRUCTURED_LOGS}"
7176
SE_OPTS="$SE_OPTS --structured-logs ${SE_STRUCTURED_LOGS}"
@@ -145,6 +150,8 @@ if [ "$SE_ENABLE_TRACING" = "true" ]; then
145150
SE_JAVA_OPTS="$SE_JAVA_OPTS ${SE_OTEL_JVM_ARGS}"
146151
fi
147152
else
153+
SE_OPTS="$SE_OPTS --tracing false"
154+
SE_JAVA_OPTS="$SE_JAVA_OPTS -Dwebdriver.remote.enableTracing=false"
148155
echo "Tracing is disabled"
149156
fi
150157

Diff for: StandaloneDocker/start-selenium-grid-docker.sh

+7
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,11 @@ if [ ! -z "$SE_LOG_LEVEL" ]; then
4444
SE_OPTS="$SE_OPTS --log-level ${SE_LOG_LEVEL}"
4545
fi
4646

47+
if [ ! -z "$SE_HTTP_LOGS" ]; then
48+
echo "Appending Selenium options: --http-logs ${SE_HTTP_LOGS}"
49+
SE_OPTS="$SE_OPTS --http-logs ${SE_HTTP_LOGS}"
50+
fi
51+
4752
if [ ! -z "$SE_STRUCTURED_LOGS" ]; then
4853
echo "Appending Selenium options: --structured-logs ${SE_STRUCTURED_LOGS}"
4954
SE_OPTS="$SE_OPTS --structured-logs ${SE_STRUCTURED_LOGS}"
@@ -106,6 +111,8 @@ if [ "$SE_ENABLE_TRACING" = "true" ]; then
106111
SE_JAVA_OPTS="$SE_JAVA_OPTS ${SE_OTEL_JVM_ARGS}"
107112
fi
108113
else
114+
SE_OPTS="$SE_OPTS --tracing false"
115+
SE_JAVA_OPTS="$SE_JAVA_OPTS -Dwebdriver.remote.enableTracing=false"
109116
echo "Tracing is disabled"
110117
fi
111118

Diff for: charts/selenium-grid/README.md

+17-14
Original file line numberDiff line numberDiff line change
@@ -313,20 +313,23 @@ Refer to below section [Configuration of Secure Communication] for more details
313313
### Configuration global
314314
For now, global configuration supported is:
315315
316-
| Parameter | Default | Description |
317-
|-----------------------------------------------------|-------------------------|---------------------------------------------|
318-
| `global.K8S_PUBLIC_IP` | `""` | Public IP of the host running K8s |
319-
| `global.seleniumGrid.imageRegistry` | `selenium` | Distribution registry to pull images |
320-
| `global.seleniumGrid.imageTag` | `4.23.0-20240727` | Image tag for all selenium components |
321-
| `global.seleniumGrid.nodesImageTag` | `4.23.0-20240727` | Image tag for browser's nodes |
322-
| `global.seleniumGrid.videoImageTag` | `ffmpeg-7.0.1-20240727` | Image tag for browser's video recorder |
323-
| `global.seleniumGrid.imagePullSecret` | `""` | Pull secret to be used for all images |
324-
| `global.seleniumGrid.affinity` | `{}` | Affinity assigned globally |
325-
| `global.seleniumGrid.logLevel` | `INFO` | Set log level for all components |
326-
| `global.seleniumGrid.defaultNodeStartupProbe` | `exec` | Default startup probe method in Nodes |
327-
| `global.seleniumGrid.defaultNodeLivenessProbe` | `exec` | Default liveness probe method in Nodes |
328-
| `global.seleniumGrid.defaultComponentLivenessProbe` | `exec` | Default liveness probe method in Components |
329-
| `global.seleniumGrid.stdoutProbeLog` | `true` | Enable probe logs output in kubectl logs |
316+
| Parameter | Default | Description |
317+
|-----------------------------------------------------|-------------------------|---------------------------------------------------------------------|
318+
| `global.K8S_PUBLIC_IP` | `""` | Public IP of the host running K8s |
319+
| `global.seleniumGrid.imageRegistry` | `selenium` | Distribution registry to pull images |
320+
| `global.seleniumGrid.imageTag` | `4.23.0-20240727` | Image tag for all selenium components |
321+
| `global.seleniumGrid.nodesImageTag` | `4.23.0-20240727` | Image tag for browser's nodes |
322+
| `global.seleniumGrid.videoImageTag` | `ffmpeg-7.0.1-20240727` | Image tag for browser's video recorder |
323+
| `global.seleniumGrid.imagePullSecret` | `""` | Pull secret to be used for all images |
324+
| `global.seleniumGrid.affinity` | `{}` | Affinity assigned globally |
325+
| `global.seleniumGrid.logLevel` | `INFO` | Set log level for all components |
326+
| `global.seleniumGrid.structuredLogs` | `false` | Use structured logs |
327+
| `global.seleniumGrid.httpLogs` | `false` | Enable http logging. Tracing should be enabled together |
328+
| `global.seleniumGrid.defaultNodeStartupProbe` | `exec` | Default startup probe method in Nodes |
329+
| `global.seleniumGrid.defaultNodeLivenessProbe` | `exec` | Default liveness probe method in Nodes |
330+
| `global.seleniumGrid.defaultComponentLivenessProbe` | `exec` | Default liveness probe method in Components |
331+
| `global.seleniumGrid.stdoutProbeLog` | `true` | Enable probe logs output in kubectl logs |
332+
| `global.seleniumGrid.revisionHistoryLimit` | `10` | Specify how many old ReplicaSets for this Deployment to be retained |
330333

331334
#### Configuration `global.K8S_PUBLIC_IP`
332335

Diff for: charts/selenium-grid/templates/logging-configmap.yaml

+3-2
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,9 @@ metadata:
1212
{{- toYaml . | nindent 4 }}
1313
{{- end }}
1414
data:
15-
SE_LOG_LEVEL: "{{ default "INFO" .Values.global.seleniumGrid.logLevel }}"
16-
SE_STRUCTURED_LOGS: "{{ default false .Values.global.seleniumGrid.structuredLogs }}"
15+
SE_LOG_LEVEL: {{ default "INFO" .Values.global.seleniumGrid.logLevel | quote }}
16+
SE_STRUCTURED_LOGS: {{ default false .Values.global.seleniumGrid.structuredLogs | quote }}
17+
SE_HTTP_LOGS: {{ default false .Values.global.seleniumGrid.httpLogs | quote }}
1718
{{- if (eq (include "seleniumGrid.enableTracing" .) "true") }}
1819
SE_ENABLE_TRACING: "true"
1920
SE_OTEL_TRACES_EXPORTER: {{ .Values.tracing.exporter | quote }}

Diff for: charts/selenium-grid/values.yaml

+2
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,8 @@ global:
3131
revisionHistoryLimit: 10
3232
# Whether to enable structured logging
3333
structuredLogs: false
34+
# Enable http logging. Tracing should be enabled to log http logs.
35+
httpLogs: false
3436

3537
tls:
3638
# Name of external secret containing the TLS certificate and key

Diff for: tests/charts/make/chart_test.sh

+1
Original file line numberDiff line numberDiff line change
@@ -111,6 +111,7 @@ HELM_COMMAND_SET_IMAGES=" \
111111
--set global.seleniumGrid.videoImageTag=${VIDEO_TAG} \
112112
--set autoscaling.scaledOptions.pollingInterval=${AUTOSCALING_POLL_INTERVAL} \
113113
--set tracing.enabled=${CHART_ENABLE_TRACING} \
114+
--set global.seleniumGrid.httpLogs=${CHART_ENABLE_TRACING} \
114115
--set isolateComponents=${CHART_FULL_DISTRIBUTED_MODE} \
115116
--set global.seleniumGrid.logLevel=${LOG_LEVEL} \
116117
"

0 commit comments

Comments
 (0)