Skip to content

Commit

Permalink
update: Tracing is enabled by default (#2347)
Browse files Browse the repository at this point in the history
Signed-off-by: Viet Nguyen Duc <nguyenducviet4496@gmail.com>
  • Loading branch information
VietND96 authored Aug 10, 2024
1 parent 821eff3 commit b49b13b
Show file tree
Hide file tree
Showing 15 changed files with 97 additions and 16 deletions.
4 changes: 4 additions & 0 deletions Base/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -159,6 +159,10 @@ ENV SE_BIND_HOST=false \
SE_OTEL_JAVA_GLOBAL_AUTOCONFIGURE_ENABLED=true \
SE_OTEL_TRACES_EXPORTER="otlp" \
SE_SUPERVISORD_LOG_LEVEL="info" \
SE_LOG_LEVEL="INFO" \
SE_HTTP_LOGS=false \
SE_STRUCTURED_LOGS=false \
SE_ENABLE_TRACING=true \
SE_ENABLE_TLS=false \
SE_JAVA_SSL_TRUST_STORE="/opt/selenium/secrets/server.jks" \
SE_JAVA_SSL_TRUST_STORE_PASSWORD="/opt/selenium/secrets/server.pass" \
Expand Down
7 changes: 7 additions & 0 deletions Distributor/start-selenium-grid-distributor.sh
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,11 @@ if [ ! -z "$SE_LOG_LEVEL" ]; then
SE_OPTS="$SE_OPTS --log-level ${SE_LOG_LEVEL}"
fi

if [ ! -z "$SE_HTTP_LOGS" ]; then
echo "Appending Selenium options: --http-logs ${SE_HTTP_LOGS}"
SE_OPTS="$SE_OPTS --http-logs ${SE_HTTP_LOGS}"
fi

if [ ! -z "$SE_STRUCTURED_LOGS" ]; then
echo "Appending Selenium options: --structured-logs ${SE_STRUCTURED_LOGS}"
SE_OPTS="$SE_OPTS --structured-logs ${SE_STRUCTURED_LOGS}"
Expand Down Expand Up @@ -136,6 +141,8 @@ if [ "$SE_ENABLE_TRACING" = "true" ]; then
SE_JAVA_OPTS="$SE_JAVA_OPTS ${SE_OTEL_JVM_ARGS}"
fi
else
SE_OPTS="$SE_OPTS --tracing false"
SE_JAVA_OPTS="$SE_JAVA_OPTS -Dwebdriver.remote.enableTracing=false"
echo "Tracing is disabled"
fi

Expand Down
7 changes: 7 additions & 0 deletions EventBus/start-selenium-grid-eventbus.sh
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,11 @@ if [ ! -z "$SE_LOG_LEVEL" ]; then
SE_OPTS="$SE_OPTS --log-level ${SE_LOG_LEVEL}"
fi

if [ ! -z "$SE_HTTP_LOGS" ]; then
echo "Appending Selenium options: --http-logs ${SE_HTTP_LOGS}"
SE_OPTS="$SE_OPTS --http-logs ${SE_HTTP_LOGS}"
fi

if [ ! -z "$SE_STRUCTURED_LOGS" ]; then
echo "Appending Selenium options: --structured-logs ${SE_STRUCTURED_LOGS}"
SE_OPTS="$SE_OPTS --structured-logs ${SE_STRUCTURED_LOGS}"
Expand Down Expand Up @@ -86,6 +91,8 @@ if [ "$SE_ENABLE_TRACING" = "true" ]; then
SE_JAVA_OPTS="$SE_JAVA_OPTS ${SE_OTEL_JVM_ARGS}"
fi
else
SE_OPTS="$SE_OPTS --tracing false"
SE_JAVA_OPTS="$SE_JAVA_OPTS -Dwebdriver.remote.enableTracing=false"
echo "Tracing is disabled"
fi

Expand Down
7 changes: 7 additions & 0 deletions Hub/start-selenium-grid-hub.sh
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,11 @@ if [ ! -z "$SE_LOG_LEVEL" ]; then
SE_OPTS="$SE_OPTS --log-level ${SE_LOG_LEVEL}"
fi

if [ ! -z "$SE_HTTP_LOGS" ]; then
echo "Appending Selenium options: --http-logs ${SE_HTTP_LOGS}"
SE_OPTS="$SE_OPTS --http-logs ${SE_HTTP_LOGS}"
fi

if [ ! -z "$SE_STRUCTURED_LOGS" ]; then
echo "Appending Selenium options: --structured-logs ${SE_STRUCTURED_LOGS}"
SE_OPTS="$SE_OPTS --structured-logs ${SE_STRUCTURED_LOGS}"
Expand Down Expand Up @@ -119,6 +124,8 @@ if [ "$SE_ENABLE_TRACING" = "true" ]; then
SE_JAVA_OPTS="$SE_JAVA_OPTS ${SE_OTEL_JVM_ARGS}"
fi
else
SE_OPTS="$SE_OPTS --tracing false"
SE_JAVA_OPTS="$SE_JAVA_OPTS -Dwebdriver.remote.enableTracing=false"
echo "Tracing is disabled"
fi

Expand Down
7 changes: 7 additions & 0 deletions NodeBase/start-selenium-node.sh
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,11 @@ if [ ! -z "$SE_LOG_LEVEL" ]; then
SE_OPTS="$SE_OPTS --log-level ${SE_LOG_LEVEL}"
fi

if [ ! -z "$SE_HTTP_LOGS" ]; then
echo "Appending Selenium options: --http-logs ${SE_HTTP_LOGS}"
SE_OPTS="$SE_OPTS --http-logs ${SE_HTTP_LOGS}"
fi

if [ ! -z "$SE_STRUCTURED_LOGS" ]; then
echo "Appending Selenium options: --structured-logs ${SE_STRUCTURED_LOGS}"
SE_OPTS="$SE_OPTS --structured-logs ${SE_STRUCTURED_LOGS}"
Expand Down Expand Up @@ -139,6 +144,8 @@ if [ "$SE_ENABLE_TRACING" = "true" ]; then
SE_JAVA_OPTS="$SE_JAVA_OPTS ${SE_OTEL_JVM_ARGS}"
fi
else
SE_OPTS="$SE_OPTS --tracing false"
SE_JAVA_OPTS="$SE_JAVA_OPTS -Dwebdriver.remote.enableTracing=false"
echo "Tracing is disabled"
fi

Expand Down
7 changes: 7 additions & 0 deletions NodeDocker/start-selenium-grid-docker.sh
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,11 @@ if [ ! -z "$SE_LOG_LEVEL" ]; then
SE_OPTS="$SE_OPTS --log-level ${SE_LOG_LEVEL}"
fi

if [ ! -z "$SE_HTTP_LOGS" ]; then
echo "Appending Selenium options: --http-logs ${SE_HTTP_LOGS}"
SE_OPTS="$SE_OPTS --http-logs ${SE_HTTP_LOGS}"
fi

if [ ! -z "$SE_STRUCTURED_LOGS" ]; then
echo "Appending Selenium options: --structured-logs ${SE_STRUCTURED_LOGS}"
SE_OPTS="$SE_OPTS --structured-logs ${SE_STRUCTURED_LOGS}"
Expand Down Expand Up @@ -96,6 +101,8 @@ if [ "$SE_ENABLE_TRACING" = "true" ]; then
SE_JAVA_OPTS="$SE_JAVA_OPTS ${SE_OTEL_JVM_ARGS}"
fi
else
SE_OPTS="$SE_OPTS --tracing false"
SE_JAVA_OPTS="$SE_JAVA_OPTS -Dwebdriver.remote.enableTracing=false"
echo "Tracing is disabled"
fi

Expand Down
7 changes: 7 additions & 0 deletions Router/start-selenium-grid-router.sh
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,11 @@ if [ ! -z "$SE_LOG_LEVEL" ]; then
SE_OPTS="$SE_OPTS --log-level ${SE_LOG_LEVEL}"
fi

if [ ! -z "$SE_HTTP_LOGS" ]; then
echo "Appending Selenium options: --http-logs ${SE_HTTP_LOGS}"
SE_OPTS="$SE_OPTS --http-logs ${SE_HTTP_LOGS}"
fi

if [ ! -z "$SE_STRUCTURED_LOGS" ]; then
echo "Appending Selenium options: --structured-logs ${SE_STRUCTURED_LOGS}"
SE_OPTS="$SE_OPTS --structured-logs ${SE_STRUCTURED_LOGS}"
Expand Down Expand Up @@ -141,6 +146,8 @@ if [ "$SE_ENABLE_TRACING" = "true" ]; then
SE_JAVA_OPTS="$SE_JAVA_OPTS ${SE_OTEL_JVM_ARGS}"
fi
else
SE_OPTS="$SE_OPTS --tracing false"
SE_JAVA_OPTS="$SE_JAVA_OPTS -Dwebdriver.remote.enableTracing=false"
echo "Tracing is disabled"
fi

Expand Down
7 changes: 7 additions & 0 deletions SessionQueue/start-selenium-grid-session-queue.sh
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,11 @@ if [ ! -z "$SE_LOG_LEVEL" ]; then
SE_OPTS="$SE_OPTS --log-level ${SE_LOG_LEVEL}"
fi

if [ ! -z "$SE_HTTP_LOGS" ]; then
echo "Appending Selenium options: --http-logs ${SE_HTTP_LOGS}"
SE_OPTS="$SE_OPTS --http-logs ${SE_HTTP_LOGS}"
fi

if [ ! -z "$SE_STRUCTURED_LOGS" ]; then
echo "Appending Selenium options: --structured-logs ${SE_STRUCTURED_LOGS}"
SE_OPTS="$SE_OPTS --structured-logs ${SE_STRUCTURED_LOGS}"
Expand Down Expand Up @@ -91,6 +96,8 @@ if [ "$SE_ENABLE_TRACING" = "true" ]; then
SE_JAVA_OPTS="$SE_JAVA_OPTS ${SE_OTEL_JVM_ARGS}"
fi
else
SE_OPTS="$SE_OPTS --tracing false"
SE_JAVA_OPTS="$SE_JAVA_OPTS -Dwebdriver.remote.enableTracing=false"
echo "Tracing is disabled"
fi

Expand Down
7 changes: 7 additions & 0 deletions Sessions/start-selenium-grid-sessions.sh
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,11 @@ if [ ! -z "$SE_LOG_LEVEL" ]; then
SE_OPTS="$SE_OPTS --log-level ${SE_LOG_LEVEL}"
fi

if [ ! -z "$SE_HTTP_LOGS" ]; then
echo "Appending Selenium options: --http-logs ${SE_HTTP_LOGS}"
SE_OPTS="$SE_OPTS --http-logs ${SE_HTTP_LOGS}"
fi

if [ ! -z "$SE_STRUCTURED_LOGS" ]; then
echo "Appending Selenium options: --structured-logs ${SE_STRUCTURED_LOGS}"
SE_OPTS="$SE_OPTS --structured-logs ${SE_STRUCTURED_LOGS}"
Expand Down Expand Up @@ -106,6 +111,8 @@ if [ "$SE_ENABLE_TRACING" = "true" ]; then
SE_JAVA_OPTS="$SE_JAVA_OPTS ${SE_OTEL_JVM_ARGS}"
fi
else
SE_OPTS="$SE_OPTS --tracing false"
SE_JAVA_OPTS="$SE_JAVA_OPTS -Dwebdriver.remote.enableTracing=false"
echo "Tracing is disabled"
fi

Expand Down
7 changes: 7 additions & 0 deletions Standalone/start-selenium-standalone.sh
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,11 @@ if [ ! -z "$SE_LOG_LEVEL" ]; then
SE_OPTS="$SE_OPTS --log-level ${SE_LOG_LEVEL}"
fi

if [ ! -z "$SE_HTTP_LOGS" ]; then
echo "Appending Selenium options: --http-logs ${SE_HTTP_LOGS}"
SE_OPTS="$SE_OPTS --http-logs ${SE_HTTP_LOGS}"
fi

if [ ! -z "$SE_STRUCTURED_LOGS" ]; then
echo "Appending Selenium options: --structured-logs ${SE_STRUCTURED_LOGS}"
SE_OPTS="$SE_OPTS --structured-logs ${SE_STRUCTURED_LOGS}"
Expand Down Expand Up @@ -145,6 +150,8 @@ if [ "$SE_ENABLE_TRACING" = "true" ]; then
SE_JAVA_OPTS="$SE_JAVA_OPTS ${SE_OTEL_JVM_ARGS}"
fi
else
SE_OPTS="$SE_OPTS --tracing false"
SE_JAVA_OPTS="$SE_JAVA_OPTS -Dwebdriver.remote.enableTracing=false"
echo "Tracing is disabled"
fi

Expand Down
7 changes: 7 additions & 0 deletions StandaloneDocker/start-selenium-grid-docker.sh
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,11 @@ if [ ! -z "$SE_LOG_LEVEL" ]; then
SE_OPTS="$SE_OPTS --log-level ${SE_LOG_LEVEL}"
fi

if [ ! -z "$SE_HTTP_LOGS" ]; then
echo "Appending Selenium options: --http-logs ${SE_HTTP_LOGS}"
SE_OPTS="$SE_OPTS --http-logs ${SE_HTTP_LOGS}"
fi

if [ ! -z "$SE_STRUCTURED_LOGS" ]; then
echo "Appending Selenium options: --structured-logs ${SE_STRUCTURED_LOGS}"
SE_OPTS="$SE_OPTS --structured-logs ${SE_STRUCTURED_LOGS}"
Expand Down Expand Up @@ -106,6 +111,8 @@ if [ "$SE_ENABLE_TRACING" = "true" ]; then
SE_JAVA_OPTS="$SE_JAVA_OPTS ${SE_OTEL_JVM_ARGS}"
fi
else
SE_OPTS="$SE_OPTS --tracing false"
SE_JAVA_OPTS="$SE_JAVA_OPTS -Dwebdriver.remote.enableTracing=false"
echo "Tracing is disabled"
fi

Expand Down
31 changes: 17 additions & 14 deletions charts/selenium-grid/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -313,20 +313,23 @@ Refer to below section [Configuration of Secure Communication] for more details
### Configuration global
For now, global configuration supported is:
| Parameter | Default | Description |
|-----------------------------------------------------|-------------------------|---------------------------------------------|
| `global.K8S_PUBLIC_IP` | `""` | Public IP of the host running K8s |
| `global.seleniumGrid.imageRegistry` | `selenium` | Distribution registry to pull images |
| `global.seleniumGrid.imageTag` | `4.23.0-20240727` | Image tag for all selenium components |
| `global.seleniumGrid.nodesImageTag` | `4.23.0-20240727` | Image tag for browser's nodes |
| `global.seleniumGrid.videoImageTag` | `ffmpeg-7.0.1-20240727` | Image tag for browser's video recorder |
| `global.seleniumGrid.imagePullSecret` | `""` | Pull secret to be used for all images |
| `global.seleniumGrid.affinity` | `{}` | Affinity assigned globally |
| `global.seleniumGrid.logLevel` | `INFO` | Set log level for all components |
| `global.seleniumGrid.defaultNodeStartupProbe` | `exec` | Default startup probe method in Nodes |
| `global.seleniumGrid.defaultNodeLivenessProbe` | `exec` | Default liveness probe method in Nodes |
| `global.seleniumGrid.defaultComponentLivenessProbe` | `exec` | Default liveness probe method in Components |
| `global.seleniumGrid.stdoutProbeLog` | `true` | Enable probe logs output in kubectl logs |
| Parameter | Default | Description |
|-----------------------------------------------------|-------------------------|---------------------------------------------------------------------|
| `global.K8S_PUBLIC_IP` | `""` | Public IP of the host running K8s |
| `global.seleniumGrid.imageRegistry` | `selenium` | Distribution registry to pull images |
| `global.seleniumGrid.imageTag` | `4.23.0-20240727` | Image tag for all selenium components |
| `global.seleniumGrid.nodesImageTag` | `4.23.0-20240727` | Image tag for browser's nodes |
| `global.seleniumGrid.videoImageTag` | `ffmpeg-7.0.1-20240727` | Image tag for browser's video recorder |
| `global.seleniumGrid.imagePullSecret` | `""` | Pull secret to be used for all images |
| `global.seleniumGrid.affinity` | `{}` | Affinity assigned globally |
| `global.seleniumGrid.logLevel` | `INFO` | Set log level for all components |
| `global.seleniumGrid.structuredLogs` | `false` | Use structured logs |
| `global.seleniumGrid.httpLogs` | `false` | Enable http logging. Tracing should be enabled together |
| `global.seleniumGrid.defaultNodeStartupProbe` | `exec` | Default startup probe method in Nodes |
| `global.seleniumGrid.defaultNodeLivenessProbe` | `exec` | Default liveness probe method in Nodes |
| `global.seleniumGrid.defaultComponentLivenessProbe` | `exec` | Default liveness probe method in Components |
| `global.seleniumGrid.stdoutProbeLog` | `true` | Enable probe logs output in kubectl logs |
| `global.seleniumGrid.revisionHistoryLimit` | `10` | Specify how many old ReplicaSets for this Deployment to be retained |

#### Configuration `global.K8S_PUBLIC_IP`

Expand Down
5 changes: 3 additions & 2 deletions charts/selenium-grid/templates/logging-configmap.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,9 @@ metadata:
{{- toYaml . | nindent 4 }}
{{- end }}
data:
SE_LOG_LEVEL: "{{ default "INFO" .Values.global.seleniumGrid.logLevel }}"
SE_STRUCTURED_LOGS: "{{ default false .Values.global.seleniumGrid.structuredLogs }}"
SE_LOG_LEVEL: {{ default "INFO" .Values.global.seleniumGrid.logLevel | quote }}
SE_STRUCTURED_LOGS: {{ default false .Values.global.seleniumGrid.structuredLogs | quote }}
SE_HTTP_LOGS: {{ default false .Values.global.seleniumGrid.httpLogs | quote }}
{{- if (eq (include "seleniumGrid.enableTracing" .) "true") }}
SE_ENABLE_TRACING: "true"
SE_OTEL_TRACES_EXPORTER: {{ .Values.tracing.exporter | quote }}
Expand Down
2 changes: 2 additions & 0 deletions charts/selenium-grid/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,8 @@ global:
revisionHistoryLimit: 10
# Whether to enable structured logging
structuredLogs: false
# Enable http logging. Tracing should be enabled to log http logs.
httpLogs: false

tls:
# Name of external secret containing the TLS certificate and key
Expand Down
1 change: 1 addition & 0 deletions tests/charts/make/chart_test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -111,6 +111,7 @@ HELM_COMMAND_SET_IMAGES=" \
--set global.seleniumGrid.videoImageTag=${VIDEO_TAG} \
--set autoscaling.scaledOptions.pollingInterval=${AUTOSCALING_POLL_INTERVAL} \
--set tracing.enabled=${CHART_ENABLE_TRACING} \
--set global.seleniumGrid.httpLogs=${CHART_ENABLE_TRACING} \
--set isolateComponents=${CHART_FULL_DISTRIBUTED_MODE} \
--set global.seleniumGrid.logLevel=${LOG_LEVEL} \
"
Expand Down

0 comments on commit b49b13b

Please sign in to comment.