Skip to content

Job application tracker and AI-powered job search assistant. Helps job seekers manage their search journey with AI resume review, job matching, task logging, and application analytics, all while keeping your data private.

feat(telemetry): wire OTEL_* passthroughs into the Jenkins deploy path

Khuram Niazd0a487a18fd9
diff --git a/.env.example b/.env.example
index 44efe46..debfe69 100644
--- a/.env.example
+++ b/.env.example
@@ -42,3 +42,12 @@ RAPIDAPI_KEY=your-rapidapi-key-here
# Enables the MCP server in production (default: on in dev, off in prod)
MCP_ENABLED=true
+
+# Observability (OTel traces + logs to a self-hosted OpenObserve instance)
+# Off by default — leave all four commented out for no change in behaviour.
+# Base URL only; the app appends /v1/traces and /v1/logs itself
+# OTEL_EXPORTER_OTLP_ENDPOINT=http://homelab:5080/api/default
+# OTEL_EXPORTER_OTLP_HEADERS=Authorization=Basic base64(email:token)
+# OTEL_SERVICE_NAME=jobsync
+# Also captures prompt/response content on LLM spans — has no effect unless OTEL_EXPORTER_OTLP_ENDPOINT above is also set
+# OTEL_CAPTURE_CONTENT=false
diff --git a/Jenkinsfile b/Jenkinsfile
index 33c0dad..14cd2dc 100644
--- a/Jenkinsfile
+++ b/Jenkinsfile
@@ -114,7 +114,10 @@ pipeline {
sh '''
set -e
- docker compose up -d \
+ docker compose \
+ -f docker-compose.yml \
+ -f docker-compose.otel.yml \
+ up -d \
--force-recreate \
--remove-orphans
'''
diff --git a/docker-compose.observability.yml b/docker-compose.observability.yml
new file mode 100644
index 0000000..7b25ee8
--- /dev/null
+++ b/docker-compose.observability.yml
@@ -0,0 +1,42 @@
+# Reference only. jobsync's deploy scripts and Jenkinsfile never touch this
+# file — run OpenObserve wherever you like and point the app at it with
+# OTEL_EXPORTER_OTLP_ENDPOINT. Kept separate from docker-compose.otel.yml on
+# purpose: merging them would force-recreate this container on every jobsync
+# deploy via --force-recreate, re-coupling their lifecycles.
+#
+# All values below are starting points, not measured. Verify them against
+# OpenObserve's current environment-variable docs, and watch actual memory and
+# CPU on the host for the first few days of real traffic. The 30-day retention
+# and the four _MAX_SIZE caps are the load-bearing ones on a memory-
+# constrained host.
+#
+# ZO_ROOT_USER_PASSWORD is validated on boot: 8-128 chars with an uppercase, a
+# lowercase, a digit and a special character. A weak value crash-loops the
+# container forever with "backend job init failed: channel closed" while :5080
+# never binds, and the real error is only visible in `docker logs`.
+services:
+ openobserve:
+ image: public.ecr.aws/zinclabs/openobserve:latest
+ container_name: openobserve
+ ports:
+ - "5080:5080"
+ volumes:
+ - ./o2-data:/data
+ environment:
+ ZO_DATA_DIR: /data
+ ZO_ROOT_USER_EMAIL: ${ZO_ROOT_USER_EMAIL}
+ ZO_ROOT_USER_PASSWORD: ${ZO_ROOT_USER_PASSWORD}
+ ZO_COMPACT_DATA_RETENTION_DAYS: "30"
+ ZO_MEMORY_CACHE_MAX_SIZE: "128"
+ ZO_MEMORY_CACHE_DATAFUSION_MAX_SIZE: "128"
+ ZO_MEM_TABLE_MAX_SIZE: "256"
+ ZO_MAX_FILE_SIZE_IN_MEMORY: "64"
+ ZO_DISK_CACHE_MAX_SIZE: "1024"
+ ZO_HTTP_WORKER_NUM: "2"
+ ZO_QUERY_THREAD_NUM: "2"
+ ZO_FILE_MOVE_THREAD_NUM: "1"
+ ZO_MEM_DUMP_THREAD_NUM: "1"
+ ZO_FILE_MERGE_THREAD_NUM: "1"
+ RUST_LOG: error
+ mem_limit: 768m
+ restart: unless-stopped
diff --git a/docker-compose.otel.yml b/docker-compose.otel.yml
new file mode 100644
index 0000000..071c6ad
--- /dev/null
+++ b/docker-compose.otel.yml
@@ -0,0 +1,13 @@
+# Merged in explicitly by the Jenkinsfile's Deploy stage:
+# docker compose -f docker-compose.yml -f docker-compose.otel.yml up -d
+# Compose merges environment: by key, so this only ADDS the four OTEL_* keys
+# to the app service — nothing in the base file is replaced. Every one
+# defaults to empty, so an operator who sets nothing in .env gets exactly
+# today's behaviour.
+services:
+ app:
+ environment:
+ - OTEL_EXPORTER_OTLP_ENDPOINT=${OTEL_EXPORTER_OTLP_ENDPOINT:-}
+ - OTEL_EXPORTER_OTLP_HEADERS=${OTEL_EXPORTER_OTLP_HEADERS:-}
+ - OTEL_SERVICE_NAME=${OTEL_SERVICE_NAME:-jobsync}
+ - OTEL_CAPTURE_CONTENT=${OTEL_CAPTURE_CONTENT:-false}