Skip to content

Commit

Permalink
Bump jaeger to 2.0.0
Browse files Browse the repository at this point in the history
Change-Id: I50be3152f25b41ecc7130bfb94a5e17e2a5c447f
  • Loading branch information
LarsMichelsen committed Nov 14, 2024
1 parent fb138bd commit 48cf37a
Show file tree
Hide file tree
Showing 13 changed files with 99 additions and 43 deletions.
6 changes: 3 additions & 3 deletions omd/packages/jaeger/BUILD
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
JAEGER_VERSION = "1.58.1"
JAEGER_VERSION = "2.0.0"

genrule(
name = "fetch_package",
Expand All @@ -12,14 +12,14 @@ genrule(
genrule(
name = "extract_binary",
srcs = [":fetch_package"],
outs = ["jaeger-all-in-one"],
outs = ["jaeger"],
cmd = """
target_path=$$(realpath $(RULEDIR)) ;\
tar -xz \
--strip-components=1 \
-C $${target_path} \
-f $(SRCS) \
jaeger-%s-linux-amd64/jaeger-all-in-one
jaeger-%s-linux-amd64/jaeger
""" % JAEGER_VERSION,
)

Expand Down
2 changes: 2 additions & 0 deletions omd/packages/jaeger/TRACE_JAEGER_ADMIN_PORT
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,8 @@ case "$1" in
echo "The port $2 is in use. I've choosen $PORT instead." >&2
echo "$PORT"
fi

sed -ri 's/address: .*/address: "[::1]:'"$PORT"'"/' "$OMD_ROOT"/etc/jaeger/omd-admin-port.yaml
;;
depends)
[ "$CONFIG_TRACE_RECEIVE" = on ]
Expand Down
1 change: 1 addition & 0 deletions omd/packages/jaeger/TRACE_JAEGER_UI_PORT
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ case "$1" in
fi

sed -ri 's/(\[::1\]:)[0-9]+/\1'"$PORT"'/' "$OMD_ROOT"/etc/jaeger/apache.conf
sed -ri 's/endpoint: .*/endpoint: "[::1]:'"$PORT"'"/' "$OMD_ROOT"/etc/jaeger/omd-query-port.yaml
;;
depends)
[ "$CONFIG_TRACE_RECEIVE" = on ]
Expand Down
11 changes: 11 additions & 0 deletions omd/packages/jaeger/TRACE_RECEIVE_ADDRESS
Original file line number Diff line number Diff line change
Expand Up @@ -8,13 +8,24 @@
# configure the IP address to listen for traces. The setting "[::]" makes the port available to all
# IPv4 and IPv6 clients.

# Load other config options. This hook needs TRACE_RECEIVE_PORT.
if [ -f "$OMD_ROOT/etc/omd/site.conf" ]; then
# shellcheck source=/dev/null
. "$OMD_ROOT/etc/omd/site.conf"
else
CONFIG_TRACE_RECEIVE_PORT=${CONFIG_TRACE_RECEIVE_PORT:-0}
fi

case "$1" in
default)
echo "[::1]"
;;
choices)
echo "@{IP_LISTEN_ADDRESS}"
;;
set)
sed -ri 's/endpoint: .*/endpoint: "'"$2:$CONFIG_TRACE_RECEIVE_PORT"'"/' "$OMD_ROOT"/etc/jaeger/omd-grpc.yaml
;;
depends)
[ "$CONFIG_TRACE_RECEIVE" = on ]
;;
Expand Down
10 changes: 10 additions & 0 deletions omd/packages/jaeger/TRACE_RECEIVE_PORT
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,14 @@
# Description:
# If receiving traces is configured, you can configure the listen port here.

# Load other config options. This hook needs TRACE_RECEIVE_PORT.
if [ -f "$OMD_ROOT/etc/omd/site.conf" ]; then
# shellcheck source=/dev/null
. "$OMD_ROOT/etc/omd/site.conf"
else
CONFIG_TRACE_RECEIVE_ADDRESS=${CONFIG_TRACE_RECEIVE_ADDRESS:-0}
fi

case "$1" in
default)
PORT=$("$OMD_ROOT"/lib/omd/next_free_port TRACE_RECEIVE_PORT 4317)
Expand All @@ -20,6 +28,8 @@ case "$1" in
echo "Trace receiving port $2 is in use. I've choosen $PORT instead." >&2
echo "$PORT"
fi

sed -ri 's/endpoint: .*/endpoint: "'"$CONFIG_TRACE_RECEIVE_ADDRESS:$PORT"'"/' "$OMD_ROOT"/etc/jaeger/omd-grpc.yaml
;;
depends)
[ "$CONFIG_TRACE_RECEIVE" = on ]
Expand Down
2 changes: 1 addition & 1 deletion omd/packages/jaeger/jaeger.make
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ $(JAEGER_BUILD):
.PHONY: $(JAEGER_INSTALL)
$(JAEGER_INSTALL): $(JAEGER_BUILD)
$(MKDIR) $(DESTDIR)$(OMD_ROOT)/bin
install -m 755 $(JAEGER_BAZEL_OUT)/jaeger-all-in-one $(DESTDIR)$(OMD_ROOT)/bin/jaeger
install -m 755 $(JAEGER_BAZEL_OUT)/jaeger $(DESTDIR)$(OMD_ROOT)/bin/jaeger
install -m 755 $(JAEGER_BAZEL_OUT)/lib/omd/hooks/TRACE_RECEIVE $(DESTDIR)$(OMD_ROOT)/lib/omd/hooks/TRACE_RECEIVE
install -m 755 $(JAEGER_BAZEL_OUT)/lib/omd/hooks/TRACE_RECEIVE_ADDRESS $(DESTDIR)$(OMD_ROOT)/lib/omd/hooks/TRACE_RECEIVE_ADDRESS
install -m 755 $(JAEGER_BAZEL_OUT)/lib/omd/hooks/TRACE_RECEIVE_PORT $(DESTDIR)$(OMD_ROOT)/lib/omd/hooks/TRACE_RECEIVE_PORT
Expand Down
6 changes: 3 additions & 3 deletions omd/packages/jaeger/jaeger_http.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,15 @@ load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_file")
load("//:bazel_variables.bzl", "UPSTREAM_MIRROR_URL")

def jaeger_workspace():
version_str = "1.58.1"
version_str = "2.0.0"
filename = "jaeger-" + version_str + "-linux-amd64.tar.gz"
upstream_url = "https://github.com/jaegertracing/jaeger/releases/download/v" + version_str + "/"
upstream_url = "https://github.com/jaegertracing/jaeger/releases/download/v1.63.0/"

http_file(
name = "jaeger",
urls = [
upstream_url + filename,
UPSTREAM_MIRROR_URL + filename,
],
sha256 = "0581d1d3c59ea32d1c3d8a1a6783341ab99a050428abb5d29c717e468680c365",
sha256 = "d2782c1a240bc2601d6cc74d181c7919e715f2d779111dbb167ec2cd9f8d2a2b",
)
17 changes: 4 additions & 13 deletions omd/packages/jaeger/skel/etc/init.d/jaeger
Original file line number Diff line number Diff line change
Expand Up @@ -9,19 +9,6 @@ PIDFILE=$OMD_ROOT/tmp/run/jaeger.pid
LOGFILE=$OMD_ROOT/var/log/jaeger.log
THE_PID=$(cat "$PIDFILE" 2>/dev/null)

# shellcheck source=/dev/null
. "$OMD_ROOT/etc/omd/site.conf"
if [ "$CONFIG_TRACE_RECEIVE" != on ]; then
exit 5
fi

# shellcheck source=/dev/null
. "$OMD_ROOT/etc/jaeger/jaeger.env"

export COLLECTOR_OTLP_GRPC_HOST_PORT="$CONFIG_TRACE_RECEIVE_ADDRESS:$CONFIG_TRACE_RECEIVE_PORT"
export ADMIN_HTTP_HOST_PORT="[::1]:$CONFIG_TRACE_JAEGER_ADMIN_PORT"
export QUERY_HTTP_SERVER_HOST_PORT="[::1]:$CONFIG_TRACE_JAEGER_UI_PORT"

case "$1" in
start)
echo -n 'Starting jaeger...'
Expand All @@ -31,6 +18,10 @@ case "$1" in
fi

nohup "$OMD_ROOT"/bin/jaeger \
--config="$OMD_ROOT"/etc/jaeger/config.yaml \
--config="$OMD_ROOT"/etc/jaeger/omd-query-port.yaml \
--config="$OMD_ROOT"/etc/jaeger/omd-admin-port.yaml \
--config="$OMD_ROOT"/etc/jaeger/omd-grpc.yaml \
>>"$LOGFILE" 2>&1 &
STATUS=$?
if [ $STATUS -eq 0 ]; then
Expand Down
44 changes: 44 additions & 0 deletions omd/packages/jaeger/skel/etc/jaeger/config.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
---
# The ports exposed with [::1]:0 are not used by us. Unfortunately
# there is currently no way to disable them completely. We assign a
# random free port to prevent conflicts with other sites on the same
# host.

service:
extensions: [jaeger_storage, jaeger_query]
pipelines:
traces:
receivers: [otlp]
processors: [batch]
exporters: [jaeger_storage_exporter]
telemetry:
resource:
service.name: jaeger

extensions:
jaeger_query:
base_path: "/###SITE###/jaeger"
storage:
traces: in_memory_store
traces_archive: in_memory_archive_store
grpc:
endpoint: "[::1]:0"

jaeger_storage:
backends:
# We use the memory backend which is by default uncapped. To prevent excessive memory
# consumption, we apply a default limit. This can be increased if needed and enough
# memory is available.
in_memory_store:
memory:
max_traces: 50000
in_memory_archive_store:
memory:
max_traces: 50000

processors:
batch:

exporters:
jaeger_storage_exporter:
trace_storage: in_memory_store
23 changes: 0 additions & 23 deletions omd/packages/jaeger/skel/etc/jaeger/jaeger.env

This file was deleted.

7 changes: 7 additions & 0 deletions omd/packages/jaeger/skel/etc/jaeger/omd-admin-port.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
---
service:
telemetry:
metrics:
level: detailed
# Updated by TRACE_JAEGER_ADMIN_PORT hook
address: "[::1]:0"
7 changes: 7 additions & 0 deletions omd/packages/jaeger/skel/etc/jaeger/omd-grpc.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
---
receivers:
otlp:
protocols:
grpc:
# Updated by TRACE_RECEIVE_* hooks
endpoint: "[::1]:0"
6 changes: 6 additions & 0 deletions omd/packages/jaeger/skel/etc/jaeger/omd-query-port.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
---
extensions:
jaeger_query:
http:
# Updated by TRACE_JAEGER_UI_PORT
endpoint: "[::1]:0"

0 comments on commit 48cf37a

Please sign in to comment.