Skip to content

Commit

Permalink
added logs configuration
Browse files Browse the repository at this point in the history
  • Loading branch information
plengauer committed Oct 9, 2023
1 parent bc8484f commit d1730fa
Show file tree
Hide file tree
Showing 5 changed files with 29 additions and 1 deletion.
8 changes: 8 additions & 0 deletions package/DEBIAN/config
Original file line number Diff line number Diff line change
Expand Up @@ -26,4 +26,12 @@ db_beginblock
db_input high gitaptly/OTLP_METRICS_HEADER || true
db_endblock

db_beginblock
db_input high gitaptly/OTLP_LOGS_ENDPOINT || true
db_endblock

db_beginblock
db_input high gitaptly/OTLP_LOGS_HEADER || true
db_endblock

db_go
2 changes: 1 addition & 1 deletion package/DEBIAN/control
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
Package: gitaptly
Version: 2.8.2
Version: 2.9.0
Architecture: all
Depends: debconf, bash, jq, cron, gzip, dpkg-dev, wget, python3, python3-pip, python3-venv
Suggests: opentelemetry-shell (>= 1.0.0)
Expand Down
12 changes: 12 additions & 0 deletions package/DEBIAN/templates
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,12 @@ Default:
Description: OTLP Endpoint:
Define the OTLP Metrics Endpoint to send metrics to, empty if no observability data should be collected.

Template: gitaptly/OTLP_LOGS_ENDPOINT
Type: string
Default:
Description: OTLP Endpoint:
Define the OTLP Logs Endpoint to send metrics to, empty if no observability data should be collected.

Template: gitaptly/OTLP_TRACES_HEADER
Type: string
Default:
Expand All @@ -33,3 +39,9 @@ Type: string
Default:
Description: OTLP Metrics API Token:
Define the API Token for the OTLP Metrics Endpoint, empty if none is required.

Template: gitaptly/OTLP_LOGS_HEADER
Type: string
Default:
Description: OTLP Logs API Token:
Define the API Token for the OTLP Logs Endpoint, empty if none is required.
4 changes: 4 additions & 0 deletions package/usr/bin/gitaptly_serve.sh
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,10 @@ if [ -f /usr/bin/opentelemetry_shell.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)
export OTEL_EXPORTER_OTLP_METRICS_ENDPOINT="$OTLP_METRICS_ENDPOINT"
export OTEL_EXPORTER_OTLP_METRICS_HEADERS=authorization=$(echo "$OTLP_METRICS_HEADER" | jq -Rr @uri)
export OTEL_EXPORTER_OTLP_LOGS_ENDPOINT="$OTLP_LOGS_ENDPOINT"
export OTEL_EXPORTER_OTLP_LOGS_HEADERS=authorization=$(echo "$OTLP_LOGS_HEADER" | jq -Rr @uri)
source /usr/bin/opentelemetry_shell.sh
fi

Expand Down
4 changes: 4 additions & 0 deletions package/usr/bin/gitaptly_update.sh
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,10 @@ if [ -f /usr/bin/opentelemetry_shell.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)
export OTEL_EXPORTER_OTLP_METRICS_ENDPOINT="$OTLP_METRICS_ENDPOINT"
export OTEL_EXPORTER_OTLP_METRICS_HEADERS=authorization=$(echo "$OTLP_METRICS_HEADER" | jq -Rr @uri)
export OTEL_EXPORTER_OTLP_LOGS_ENDPOINT="$OTLP_LOGS_ENDPOINT"
export OTEL_EXPORTER_OTLP_LOGS_HEADERS=authorization=$(echo "$OTLP_LOGS_HEADER" | jq -Rr @uri)
source /usr/bin/opentelemetry_shell.sh
otel_instrument dpkg-scanpackages
otel_outstrument cut
Expand Down

0 comments on commit d1730fa

Please sign in to comment.