OpenObserve replaces Temps as the telemetry sink
Browse files at this commit5a1ac4253afbd18dc827ec662a15d4f5f47c5ec7Parent: 66c56ad- feat
- OpenObserve replaces Temps as the telemetry sink
4 changed files +56 -155
- README.md +14 -16
- compose.yaml +42 -118
- observability/Containerfile.temps +0 -20
- observability/temps-admin-password +0 -1
README.mdmodified+14 -16
| @@ -240,22 +240,20 @@ container so the published port works. Production knobs (`COOKIE_SECURE`, | |||
| 240 | means dev mirror mode without credentials; a cookie-using browser frontend | 240 | means dev mirror mode without credentials; a cookie-using browser frontend |
| 241 | must be allowlisted explicitly. Works with `docker compose` too. | 241 | must be allowlisted explicitly. Works with `docker compose` too. |
| 242 | 242 | ||
| 243 | -Three more services make up the telemetry sink: `temps` (UI and API on | 243 | +One more service is the telemetry sink: `openobserve`, a single Rust binary |
| 244 | -`127.0.0.1:3000`, OTLP ingest on `127.0.0.1:9000`) with its TimescaleDB and | 244 | +that stores logs, metrics and traces itself — no sidecar databases and no |
| 245 | -ClickHouse stores. Its image is built locally from | 245 | +container socket. Its UI, search API and OTLP/HTTP ingest share |
| 246 | -`observability/Containerfile.temps` — the published one is tagged alpine but | 246 | +`127.0.0.1:5080`; OTLP/gRPC listens on `127.0.0.1:5081`. Log in at |
| 247 | -ships a glibc binary that cannot exec. Temps refuses to start its console | 247 | +http://127.0.0.1:5080 as the `ZO_ROOT_USER_EMAIL`/`ZO_ROOT_USER_PASSWORD` pair |
| 248 | -without a container socket, so `systemctl --user start podman.socket` first. | 248 | +set on the service (`admin@hezarfen.local` / `Hezarfen_dev1!` for local dev — |
| 249 | -Log in at http://127.0.0.1:3000 as `admin@hezarfen.local` with the password in | 249 | +OpenObserve rejects a weaker password at boot). Retention is per stream in |
| 250 | -`observability/temps-admin-password`, then mint an ingest key (Settings → API | 250 | +days, defaulted globally to 90 by `ZO_COMPACT_DATA_RETENTION_DAYS`. Uncomment |
| 251 | -Keys, or `podman exec hezarfen-temps temps api-key --name <name>`) and note the | 251 | +the backend's `OTEL_EXPORTER_OTLP_ENDPOINT` (`http://openobserve:5081`) and |
| 252 | -project id shown on the project page. Uncomment the backend's | 252 | +`OTEL_EXPORTER_OTLP_HEADERS` (`Authorization=Basic <base64 email:password>` |
| 253 | -`OTEL_EXPORTER_OTLP_ENDPOINT` (`http://temps:9000/api/otel`), | 253 | +plus `organization=default,stream-name=default`), and traces, metrics and logs |
| 254 | -`OTEL_EXPORTER_OTLP_PROTOCOL` (`http/protobuf` — Temps has no gRPC listener) | 254 | +start landing; the commented OTLP/HTTP variant uses |
| 255 | -and `OTEL_EXPORTER_OTLP_HEADERS` | 255 | +`http://openobserve:5080/api/default` with `OTEL_EXPORTER_OTLP_PROTOCOL: |
| 256 | -(`Authorization=Bearer <key>,X-Temps-Project-Id=<id>`), and traces, metrics and | 256 | +http/protobuf` instead. |
| 257 | -logs start landing. Signals are kept 90 days | ||
| 258 | -(`TEMPS_OTEL_RETENTION_DAYS`). | ||
| 259 | 257 | ||
| 260 | The backend survives the database going away, at boot and at runtime. | 258 | The backend survives the database going away, at boot and at runtime. |
| 261 | 259 | ||
compose.yamlmodified+42 -118
| @@ -58,16 +58,18 @@ services: | |||
| 58 | # RATE_LIMIT_AUTH_PER_MINUTE: "10" | 58 | # RATE_LIMIT_AUTH_PER_MINUTE: "10" |
| 59 | # RATE_LIMIT_API_PER_MINUTE: "300" | 59 | # RATE_LIMIT_API_PER_MINUTE: "300" |
| 60 | # TRUST_PROXY: "true" | 60 | # TRUST_PROXY: "true" |
| 61 | - # Telemetry — export traces, metrics and logs to Temps over OTLP/HTTP. | 61 | + # Telemetry — export traces, metrics and logs to OpenObserve over OTLP. |
| 62 | - # Uncomment once a Temps project exists: create the project in the UI at | 62 | + # The Authorization value is base64("<ZO_ROOT_USER_EMAIL>:<password>"); |
| 63 | - # http://127.0.0.1:3000, mint an API key (tk_...) under Settings > API | 63 | + # for the local-dev pair above that is the string below. gRPC carries the |
| 64 | - # Keys, and put its numeric project id in the header. OTLP/HTTP protobuf | 64 | + # organization and the target stream as metadata headers. |
| 65 | - # only — Temps has no gRPC port, and the ingest path is /api/otel/v1/*, | 65 | + # OTEL_EXPORTER_OTLP_ENDPOINT: http://openobserve:5081 |
| 66 | - # so the endpoint carries the /api/otel prefix. | 66 | + # OTEL_EXPORTER_OTLP_HEADERS: "Authorization=Basic YWRtaW5AaGV6YXJmZW4ubG9jYWw6SGV6YXJmZW5fZGV2MSE=,organization=default,stream-name=default" |
| 67 | - # OTEL_EXPORTER_OTLP_ENDPOINT: http://temps:9000/api/otel | ||
| 68 | - # OTEL_EXPORTER_OTLP_PROTOCOL: http/protobuf | ||
| 69 | - # OTEL_EXPORTER_OTLP_HEADERS: "Authorization=Bearer tk_xxx,X-Temps-Project-Id=1" | ||
| 70 | # OTEL_SERVICE_NAME: hezarfen-backend | 67 | # OTEL_SERVICE_NAME: hezarfen-backend |
| 68 | + # OTLP/HTTP instead: the org goes in the path (the SDK appends | ||
| 69 | + # /v1/{traces,metrics,logs}) and only Authorization is needed. | ||
| 70 | + # OTEL_EXPORTER_OTLP_ENDPOINT: http://openobserve:5080/api/default | ||
| 71 | + # OTEL_EXPORTER_OTLP_PROTOCOL: http/protobuf | ||
| 72 | + # OTEL_EXPORTER_OTLP_HEADERS: "Authorization=Basic YWRtaW5AaGV6YXJmZW4ubG9jYWw6SGV6YXJmZW5fZGV2MSE=" | ||
| 71 | # AI bridge — the AI services dial IN over QUIC. Unset means off; a | 73 | # AI bridge — the AI services dial IN over QUIC. Unset means off; a |
| 72 | # bad address or a missing token fails the boot rather than leaving a | 74 | # bad address or a missing token fails the boot rather than leaving a |
| 73 | # silently dead feature. Listening with no service connected is fine: | 75 | # silently dead feature. Listening with no service connected is fine: |
| @@ -91,123 +93,45 @@ services: | |||
| 91 | start_period: 10s | 93 | start_period: 10s |
| 92 | 94 | ||
| 93 | # ── Telemetry sink ──────────────────────────────────────────────────────── | 95 | # ── Telemetry sink ──────────────────────────────────────────────────────── |
| 94 | - # Temps is the only telemetry sink (no Grafana/Jaeger/Loki). It stores | 96 | + # OpenObserve is the only telemetry sink (no Grafana/Jaeger/Loki): one Rust |
| 95 | - # metadata in TimescaleDB and the OTLP signals themselves in ClickHouse, so | 97 | + # binary, its own storage, no container socket and no sidecar databases. It |
| 96 | - # both come along. Neither database is published to the host; only the Temps | 98 | + # speaks OTLP itself — HTTP on 5080 (also the UI and the search API), gRPC on |
| 97 | - # API/UI (3000) and its public ingest listener (9000) are, on loopback. | 99 | + # 5081. Both are published on loopback only. |
| 98 | - temps-postgres: | 100 | + openobserve: |
| 99 | - image: docker.io/gotempsh/timescaledb-walg:pg18 | 101 | + image: docker.io/openobserve/openobserve:v1.0.0-rc2 |
| 100 | - container_name: hezarfen-temps-postgres | 102 | + container_name: hezarfen-openobserve |
| 101 | - environment: | ||
| 102 | - POSTGRES_DB: temps | ||
| 103 | - POSTGRES_USER: temps | ||
| 104 | - # Local-dev credential, same status as the root/root above. Never leaves | ||
| 105 | - # the compose network — the port is not published. | ||
| 106 | - POSTGRES_PASSWORD: temps_local_dev | ||
| 107 | - TIMESCALEDB_TELEMETRY: off | ||
| 108 | - volumes: | ||
| 109 | - # Spilo/timescaledb-ha initialises its cluster here, not in the stock | ||
| 110 | - # postgres image's /var/lib/postgresql/data. Mounting the wrong path | ||
| 111 | - # loses everything on every recreation. | ||
| 112 | - - temps-postgres-data:/home/postgres/pgdata/data | ||
| 113 | - restart: unless-stopped | ||
| 114 | - healthcheck: | ||
| 115 | - test: | ||
| 116 | - [ | ||
| 117 | - "CMD-SHELL", | ||
| 118 | - "PGPASSWORD=$$POSTGRES_PASSWORD psql -h 127.0.0.1 -U temps -d temps -tAc 'SELECT 1' | grep -qx 1", | ||
| 119 | - ] | ||
| 120 | - interval: 10s | ||
| 121 | - timeout: 5s | ||
| 122 | - retries: 12 | ||
| 123 | - start_period: 30s | ||
| 124 | - | ||
| 125 | - temps-clickhouse: | ||
| 126 | - image: docker.io/clickhouse/clickhouse-server:26.7.5.10-alpine | ||
| 127 | - container_name: hezarfen-temps-clickhouse | ||
| 128 | - environment: | ||
| 129 | - CLICKHOUSE_DB: temps | ||
| 130 | - CLICKHOUSE_USER: temps | ||
| 131 | - CLICKHOUSE_PASSWORD: temps_local_dev | ||
| 132 | - volumes: | ||
| 133 | - - temps-clickhouse-data:/var/lib/clickhouse | ||
| 134 | - ulimits: | ||
| 135 | - nofile: | ||
| 136 | - soft: 262144 | ||
| 137 | - hard: 262144 | ||
| 138 | - restart: unless-stopped | ||
| 139 | - healthcheck: | ||
| 140 | - test: ["CMD", "clickhouse-client", "--user", "temps", "--database", "temps", "--query", "SELECT 1"] | ||
| 141 | - interval: 10s | ||
| 142 | - timeout: 5s | ||
| 143 | - retries: 12 | ||
| 144 | - start_period: 20s | ||
| 145 | - | ||
| 146 | - temps: | ||
| 147 | - # Built locally from the pinned upstream artifact — see | ||
| 148 | - # observability/Containerfile.temps for why the published image can't run. | ||
| 149 | - build: | ||
| 150 | - context: ./observability | ||
| 151 | - dockerfile: Containerfile.temps | ||
| 152 | - image: localhost/hezarfen-temps:0.1.0-nightly.20260906.48c2396e | ||
| 153 | - container_name: hezarfen-temps | ||
| 154 | environment: | 103 | environment: |
| 155 | - TEMPS_DATABASE_URL: postgresql://temps:temps_local_dev@temps-postgres:5432/temps | 104 | + # First-boot root account, created once. Local-dev credentials, same |
| 156 | - # UI + API on 3000, public ingest (OTLP among it) on 9000. | 105 | + # status as the root/root above — change them before this is reachable |
| 157 | - TEMPS_ADDRESS: 0.0.0.0:3000 | 106 | + # from anywhere but your machine. OpenObserve enforces a password policy |
| 158 | - TEMPS_CONSOLE_ADDRESS: 0.0.0.0:9000 | 107 | + # (8-128 chars, upper + lower + digit + special) and panics on boot |
| 159 | - TEMPS_DATA_DIR: /app/data | 108 | + # otherwise, hence the shape of this one. |
| 160 | - TEMPS_LOG_LEVEL: info | 109 | + ZO_ROOT_USER_EMAIL: admin@hezarfen.local |
| 161 | - TEMPS_CLICKHOUSE_URL: http://temps-clickhouse:8123 | 110 | + ZO_ROOT_USER_PASSWORD: Hezarfen_dev1! |
| 162 | - TEMPS_CLICKHOUSE_DATABASE: temps | 111 | + ZO_DATA_DIR: /data |
| 163 | - TEMPS_CLICKHOUSE_USER: temps | 112 | + # Retention is per stream in days; this is the global default applied to |
| 164 | - TEMPS_CLICKHOUSE_PASSWORD: temps_local_dev | 113 | + # streams that don't override it (upstream default is 3650). |
| 165 | - # Signal retention. 90 is also Temps' own default (the spans table's | 114 | + ZO_COMPACT_DATA_RETENTION_DAYS: "90" |
| 166 | - # `retention_days` column defaults to 90 and the TTL is derived from it), | ||
| 167 | - # set here so the number is in the file rather than only in Temps' own | ||
| 168 | - # settings row, which the console can change. | ||
| 169 | - TEMPS_OTEL_RETENTION_DAYS: "90" | ||
| 170 | - # First-boot admin, created once. The password is mounted from a file so | ||
| 171 | - # it stays out of argv; change observability/temps-admin-password before | ||
| 172 | - # this is reachable from anywhere but your machine. | ||
| 173 | - TEMPS_ADMIN_EMAIL: admin@hezarfen.local | ||
| 174 | - TEMPS_ADMIN_PASSWORD_FILE: /run/temps/admin_password | ||
| 175 | - TEMPS_EXECUTION_ENV: docker | ||
| 176 | ports: | 115 | ports: |
| 177 | - - "127.0.0.1:3000:3000" | 116 | + - "127.0.0.1:5080:5080" |
| 178 | - - "127.0.0.1:9000:9000" | 117 | + - "127.0.0.1:5081:5081" |
| 179 | volumes: | 118 | volumes: |
| 180 | - - temps-data:/app/data | 119 | + - openobserve-data:/data |
| 181 | - - ./observability/temps-admin-password:/run/temps/admin_password:ro | ||
| 182 | - # Temps refuses to start its console (UI + OTLP ingest) without a | ||
| 183 | - # container socket. Podman's API is Docker-compatible; start it with | ||
| 184 | - # `systemctl --user start podman.socket`. Running as root inside the | ||
| 185 | - # container is what makes the rootless socket readable (container root | ||
| 186 | - # maps to your host user) — same reasoning as surrealdb above. | ||
| 187 | - - ${XDG_RUNTIME_DIR:-/run/user/1000}/podman/podman.sock:/var/run/docker.sock | ||
| 188 | - user: "0" | ||
| 189 | - # SELinux blocks reading the podman socket from inside the container | ||
| 190 | - # ("Permission denied", which Temps reports as "Socket not found"). | ||
| 191 | - # Relabelling the socket itself would break podman, so the label is | ||
| 192 | - # dropped for this container only. | ||
| 193 | - security_opt: | ||
| 194 | - - label=disable | ||
| 195 | - depends_on: | ||
| 196 | - temps-postgres: | ||
| 197 | - condition: service_healthy | ||
| 198 | - temps-clickhouse: | ||
| 199 | - condition: service_healthy | ||
| 200 | restart: unless-stopped | 120 | restart: unless-stopped |
| 201 | healthcheck: | 121 | healthcheck: |
| 202 | - test: ["CMD", "wget", "--no-verbose", "--tries=1", "--spider", "http://127.0.0.1:9000/readyz"] | 122 | + # corner-cut: the image is distroless (only /openobserve, no shell and no |
| 123 | + # HTTP client), so the container cannot probe its own /healthz. `node | ||
| 124 | + # list` is the closest in-image liveness signal — it succeeds only once | ||
| 125 | + # the node has registered itself in the cluster registry, which happens | ||
| 126 | + # after the server starts. Ceiling: it does not prove the HTTP listener | ||
| 127 | + # answers; from the host that is `curl -fsS http://127.0.0.1:5080/healthz`. | ||
| 128 | + test: ["CMD", "/openobserve", "node", "list"] | ||
| 203 | interval: 30s | 129 | interval: 30s |
| 204 | timeout: 5s | 130 | timeout: 5s |
| 205 | - retries: 3 | 131 | + retries: 5 |
| 206 | - start_period: 40s | 132 | + start_period: 10s |
| 207 | 133 | ||
| 208 | volumes: | 134 | volumes: |
| 209 | hezarfen-data: | 135 | hezarfen-data: |
| 210 | surreal-data: | 136 | surreal-data: |
| 211 | - temps-postgres-data: | 137 | + openobserve-data: |
| 212 | - temps-clickhouse-data: | ||
| 213 | - temps-data: | ||
observability/Containerfile.tempsdeleted+0 -20
| @@ -1,20 +0,0 @@ | |||
| 1 | -# Temps ships a broken runtime image: ghcr.io/gotempsh/temps:* is alpine/musl | ||
| 2 | -# but the binary inside is glibc-linked, so it dies with "exec container | ||
| 3 | -# process (missing dynamic library?) /usr/local/bin/temps". Their supported | ||
| 4 | -# path is building the whole thing from source. Rebasing the same pinned | ||
| 5 | -# artifact onto debian-slim gives a runnable image in seconds instead. | ||
| 6 | -# Delete this file and use the upstream image directly once it executes. | ||
| 7 | -FROM ghcr.io/gotempsh/temps:0.1.0-nightly.20260906.48c2396e AS artifacts | ||
| 8 | - | ||
| 9 | -FROM docker.io/library/debian:bookworm-slim | ||
| 10 | -RUN apt-get update \ | ||
| 11 | - && apt-get install -y --no-install-recommends ca-certificates tzdata wget \ | ||
| 12 | - && rm -rf /var/lib/apt/lists/* | ||
| 13 | -COPY --from=artifacts /usr/local/bin/temps /usr/local/bin/temps | ||
| 14 | -RUN useradd --uid 1000 --create-home temps \ | ||
| 15 | - && mkdir -p /app/data \ | ||
| 16 | - && chown -R temps:temps /app | ||
| 17 | -USER temps | ||
| 18 | -WORKDIR /app | ||
| 19 | -ENTRYPOINT ["/usr/local/bin/temps"] | ||
| 20 | -CMD ["serve"] | ||
observability/temps-admin-passworddeleted+0 -1
| @@ -1 +0,0 @@ | |||
| 1 | -Temps-Local-Dev-1 | ||