Skip to content

Commit

Permalink
fixed observability dependency
Browse files Browse the repository at this point in the history
  • Loading branch information
plengauer committed Sep 17, 2023
1 parent e46108f commit 5ca974e
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 10 deletions.
4 changes: 2 additions & 2 deletions package/usr/bin/gitaptly_run_ftp.sh
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@ if [ -n "$OTLP_TRACES_ENDPOINT" ] || [ -n "$OTLP_METRICS_ENDPOINT" ]; then
export OTEL_METRICS_EXPORTER=otlp_proto_http
export OTEL_EXPORTER_OTLP_TRACES_ENDPOINT="$OTLP_TRACES_ENDPOINT"
export OTEL_EXPORTER_OTLP_METRICS_ENDPOINT="$OTLP_METRICS_ENDPOINT"
export OTEL_EXPORTER_OTLP_TRACES_HEADERS=authentication=$(echo "$OTLP_TRACES_HEADER" | jq -Rr @uri)
export OTEL_EXPORTER_OTLP_METRICS_HEADERS=authentication=$(echo "$OTLP_METRICS_HEADER" | jq -Rr @uri)
export OTEL_EXPORTER_OTLP_TRACES_HEADERS=authorization=$(echo "$OTLP_TRACES_HEADER" | jq -Rr @uri)
export OTEL_EXPORTER_OTLP_METRICS_HEADERS=authorization=$(echo "$OTLP_METRICS_HEADER" | jq -Rr @uri)
cmd=(opentelemetry-instrument "${cmd[@]}")
fi
exec "${cmd[@]}"
10 changes: 6 additions & 4 deletions package/usr/bin/gitaptly_serve.sh
Original file line number Diff line number Diff line change
@@ -1,10 +1,12 @@
#!/bin/bash
set -e
source /opt/gitaptly/env
export OTEL_SERVICE_NAME=GitAptly
export OTEL_EXPORTER_OTLP_TRACES_ENDPOINT="$OTLP_TRACES_ENDPOINT"
export OTEL_EXPORTER_OTLP_TRACES_HEADERS="$OTLP_TRACES_HEADERS"
source /usr/bin/opentelemetry_bash.sh
if [ -f /usr/bin/opentelemetry_bash.sh ]; then
export OTEL_SERVICE_NAME=GitAptly
export OTEL_EXPORTER_OTLP_TRACES_ENDPOINT="$OTLP_TRACES_ENDPOINT"
export OTEL_EXPORTER_OTLP_TRACES_HEADERS=authorization=$(echo "$OTLP_TRACES_HEADER" | jq -Rr @uri)
source /usr/bin/opentelemetry_bash.sh
fi

path="$SCRIPT_NAME"
file=$(echo "$path" | rev | cut -d/ -f1 | rev)
Expand Down
10 changes: 6 additions & 4 deletions package/usr/bin/gitaptly_update.sh
Original file line number Diff line number Diff line change
@@ -1,10 +1,12 @@
#!/bin/bash
set -e
source /opt/gitaptly/env
export OTEL_SERVICE_NAME=GitAptly
export OTEL_EXPORTER_OTLP_TRACES_ENDPOINT="$OTLP_TRACES_ENDPOINT"
export OTEL_EXPORTER_OTLP_TRACES_HEADERS="$OTLP_TRACES_HEADERS"
source /usr/bin/opentelemetry_bash.sh
if [ -f /usr/bin/opentelemetry_bash.sh ]; then
export OTEL_SERVICE_NAME=GitAptly
export OTEL_EXPORTER_OTLP_TRACES_ENDPOINT="$OTLP_TRACES_ENDPOINT"
export OTEL_EXPORTER_OTLP_TRACES_HEADERS=authorization=$(echo "$OTLP_TRACES_HEADER" | jq -Rr @uri)
source /usr/bin/opentelemetry_bash.sh
fi
cd /var/lib/gitaptly

source /opt/gitaptly/env
Expand Down

0 comments on commit 5ca974e

Please sign in to comment.