Skip to content

Commit

Permalink
feat: disable OTEL using DISABLE_OTEL=false
Browse files Browse the repository at this point in the history
  • Loading branch information
ludovicm67 committed Nov 28, 2023
1 parent 1d4fb50 commit 612d4a1
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 2 deletions.
5 changes: 5 additions & 0 deletions .changeset/loud-files-live.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"fuseki-geosparql": minor
---

OpenTelemetry support can be disabled by configuring the `DISABLE_OTEL` environment variable to `false`.
3 changes: 2 additions & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,8 @@ ENV \
FUSEKI_BASE="${FUSEKI_BASE}" \
OTEL_TRACES_EXPORTER="none" \
OTEL_METRICS_EXPORTER="none" \
ADMIN_PASSWORD="admin"
ADMIN_PASSWORD="admin" \
DISABLE_OTEL="false"

# run as "fuseki" (explicit UID so "run as non-root" policies can be enforced)
USER 1000
Expand Down
10 changes: 9 additions & 1 deletion entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,18 @@ envsubst '$ADMIN_PASSWORD' \
< "${FUSEKI_HOME}/shiro.ini" \
> "${FUSEKI_BASE}/shiro.ini"

JAVA_AGENT="-javaagent:${FUSEKI_HOME}/otel.jar"

# Check if the environment variable DISABLE_OTEL is set to "true"
if [ "$DISABLE_OTEL" = "true" ]; then
echo "Removing OpenTelemetry Java Agent…"
JAVA_AGENT=""
fi

exec \
"${JAVA_HOME}/bin/java" \
${JAVA_OPTS} \
-javaagent:"${FUSEKI_HOME}/otel.jar" \
${JAVA_AGENT} \
-Xshare:off \
-Dlog4j.configurationFile="${FUSEKI_HOME}/log4j2.properties" \
-cp "${FUSEKI_HOME}/fuseki-server.jar" \
Expand Down

0 comments on commit 612d4a1

Please sign in to comment.