From 8779d765836718ebe968f9f172ae8f05e7479165 Mon Sep 17 00:00:00 2001 From: Marc Cataford Date: Sun, 29 Sep 2024 23:18:56 -0400 Subject: [PATCH] feat: add otel tracing --- Caddyfile | 10 ++++++++-- caddy.Dockerfile | 4 ++++ 2 files changed, 12 insertions(+), 2 deletions(-) diff --git a/Caddyfile b/Caddyfile index ff09ac4..5a9f9f5 100644 --- a/Caddyfile +++ b/Caddyfile @@ -15,7 +15,13 @@ (application_base) { import application_logging {args[0]} - reverse_proxy host.containers.internal:{args[1]} + + tracing { + span api + } + + reverse_proxy host.containers.internal:{args[1]} + } (internal_base) { @@ -24,7 +30,7 @@ } { - log default { + log default { output stdout output file /var/log/caddy/caddy_main.log { roll_size 100MiB diff --git a/caddy.Dockerfile b/caddy.Dockerfile index 4e70a86..de0667f 100644 --- a/caddy.Dockerfile +++ b/caddy.Dockerfile @@ -4,3 +4,7 @@ RUN apk update && \ apk add nss-tools COPY ./Caddyfile /etc/caddy + +ENV OTEL_EXPORTER_OTLP_ENDPOINT=otlp://host.containers.internal:4318 +ENV OTEL_EXPORTER_OTLP_TRACES_ENDPOINT=otlp://host.containers.internal:4318 +ENV OTEL_EXPORTER_OTLP_INSECURE=true