Skip to content

Commit 414bfba

Browse files
authored
observability: make telemetry export explicit opt-in
Default Star Server telemetry export to off, require an explicit deployment gate in addition to loading the observability addon, update hermetic coverage, and document the Biz/infra activation contract.
1 parent 1ac298b commit 414bfba

4 files changed

Lines changed: 42 additions & 22 deletions

File tree

‎doc/configuration.org‎

Lines changed: 16 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -46,22 +46,27 @@ server process.
4646

4747
** Observability configuration
4848

49-
Telemetry is OFF until the operator opts in from the init file:
49+
Telemetry export requires two explicit opt-ins:
50+
51+
1. the deployment sets =STAR_OBSERVABILITY_ENABLED=true=; and
52+
2. the trusted init file loads the addon:
5053

5154
#+begin_src lisp
5255
(load-addon :starintel-observability)
5356
#+end_src
5457

55-
Loading the addon starts the exporter thread and wires the instrumented
56-
CouchDB transport. Without that line, no exporter thread, no queues, no
57-
ids, and no counters run; the application has no telemetry dependency. The
58-
env kill switch below still overrides everything.
58+
Loading the addon with the export gate disabled starts no exporter. Leaving the
59+
addon unloaded starts no exporter thread, queues, ids, or counters. Hosted
60+
StarIntel deployments render the export gate from
61+
=starintel.biz.observability.enable=, which defaults to false. This keeps both
62+
package installation and addon availability separate from consent to export
63+
telemetry.
5964

6065
Observability env variables (read by the =star.observability= library):
6166

6267
| Variable | Default | Meaning |
6368
|----------+---------+---------|
64-
| =STAR_OBSERVABILITY_ENABLED= | =true= | kill switch; =false= disables all export |
69+
| =STAR_OBSERVABILITY_ENABLED= | =false= | explicit export gate; set =true= to permit export when the addon is loaded |
6570
| =STAR_OBSERVABILITY_ENDPOINT= | =http://127.0.0.1:4318= | OTLP/HTTP collector endpoint (compose: =http://otelcol:4318=) |
6671
| =STAR_OBSERVABILITY_SIGNALS= | =logs,metrics,traces= | comma-separated signals to record |
6772
| =STAR_TRACE_SAMPLE_RATE= | =1.0= | SDK-side rate; the collector tail-samples authoritatively (5% baseline) |
@@ -121,10 +126,11 @@ as an environment variable.
121126
The initializer attaches =star:observability-lease-metrics-hook= to the
122127
store, so =starintel_lease_stale_writer_rejections_total=,
123128
=starintel_lease_conflicts_total= and =starintel_lease_acquisitions_total=
124-
flow whenever the observability addon is loaded. When Valkey is unreachable,
125-
lease operations degrade per the adapter's bounded retry contract: they
126-
return retryable =:backend-unavailable= / =:timeout= / =:outcome-unknown=
127-
outcomes within the caller's deadline instead of signaling.
129+
flow when the observability addon is loaded and the explicit export gate is
130+
enabled. When Valkey is unreachable, lease operations degrade per the adapter's
131+
bounded retry contract: they return retryable =:backend-unavailable= / =:timeout=
132+
/ =:outcome-unknown= outcomes within the caller's deadline instead of
133+
signaling.
128134

129135
The init file can override any knob before runtime start (the environment is
130136
read only when the image loads):

‎doc/observability.org‎

Lines changed: 11 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -25,13 +25,18 @@ OpenObserve client. OpenObserve stays replaceable.
2525

2626
* CURRENT implementation
2727

28-
** Telemetry lifecycle (opt-in via init file)
28+
** Telemetry lifecycle (explicit opt-in)
2929

3030
- The addon is registered at gserver load (metadata only).
3131
- Nothing runs until the operator adds =(load-addon :starintel-observability)=
3232
to the trusted init file. Without it: no exporter thread, no queues, no
3333
ids, no counters (verified by the =disabled-addon-costs-nothing= test).
34-
- The env kill switch =STAR_OBSERVABILITY_ENABLED=false= overrides the addon.
34+
- Export is additionally fail-safe gated by =STAR_OBSERVABILITY_ENABLED=,
35+
which defaults to =false=. The addon starts an exporter only when the value
36+
is explicitly set to =true= (or another documented truthy value).
37+
- Hosted deployments get that explicit flag from the StarIntel Biz/infra
38+
=starintel.biz.observability.enable= switch; loading the addon alone is not
39+
consent to export telemetry.
3540
- =stop-runtime= is NOT wired to telemetry; the addon lifecycle owns
3641
start/stop, exactly like =starintel-bixby=.
3742

@@ -80,7 +85,8 @@ CouchDB joins one distributed trace when each hop carries the header.
8085
=star.observability= is covered by =t/observability-test.lisp= (FiveAM,
8186
hermetic):
8287

83-
- config: enabled by default; disabled addon costs nothing;
88+
- config: disabled by default; explicit truthy opt-in; disabled addon costs
89+
nothing;
8490
- W3C traceparent round-trip + malformed rejection;
8591
- child context keeps trace id and records parent;
8692
- structural redaction incl. case-insensitive forbidden keys;
@@ -115,7 +121,7 @@ Run: =nix run .#star-unit-tests=.
115121

116122
| Symptom | Check |
117123
|---------+-------|
118-
| No telemetry at the gateway | Was the addon loaded in init.lisp? Is =STAR_OBSERVABILITY_ENDPOINT= reachable (compose: =http://otelcol:4318=)? |
124+
| No telemetry at the gateway | Is =STAR_OBSERVABILITY_ENABLED=true=? Was the addon loaded in init.lisp? Is =STAR_OBSERVABILITY_ENDPOINT= reachable (compose: =http://otelcol:4318=)? |
119125
| Collector export 401 | Gateway ingest token rotated: re-run =openobserve-provision= on observe (infra side); the sidecar itself holds no credential |
120126
| Spans missing but logs present | =STAR_OBSERVABILITY_SIGNALS= contents; collector =tail_sampling= baseline (5%) |
121-
| Telemetry volume explosion | =STAR_ACTOR_DETAIL=, =STAR_PROLOG_DETAIL=, span budget test |
127+
| Telemetry volume explosion | =STAR_ACTOR_DETAIL=, =STAR_PROLOG_DETAIL=, span budget test |

‎source/observability/config.lisp‎

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,11 @@
11
(in-package :star.observability)
22

33
(defparameter *observability-enabled*
4-
(or (uiop:getenv "STAR_OBSERVABILITY_ENABLED") "true")
5-
"Whether telemetry is exported. Enabled by default per the locked
6-
observability-slice decision; set STAR_OBSERVABILITY_ENABLED=false to disable.
7-
Disabled mode starts no exporter thread and performs no network I/O.")
4+
(or (uiop:getenv "STAR_OBSERVABILITY_ENABLED") "false")
5+
"Whether telemetry is exported. Disabled by default: hosted deployments
6+
must opt in explicitly (the StarIntel Biz/infra policy propagates
7+
STAR_OBSERVABILITY_ENABLED=true). Disabled mode starts no exporter thread and
8+
performs no network I/O.")
89

910
(defparameter *observability-endpoint*
1011
(or (uiop:getenv "STAR_OBSERVABILITY_ENDPOINT")

‎t/observability-test.lisp‎

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,9 +18,16 @@
1818
(funcall thunk)
1919
(star.observability:reset-exporter-state))))
2020

21-
(test config-enabled-by-default
22-
"Telemetry is enabled by default per the locked slice decision."
23-
(is (star.observability:observability-enabled-p)))
21+
(test config-disabled-by-default
22+
"Telemetry requires an explicit deployment opt-in."
23+
(let ((star.observability::*observability-enabled* "false"))
24+
(is (not (star.observability:observability-enabled-p)))))
25+
26+
(test config-explicit-opt-in
27+
"The deployment gate accepts the documented truthy values."
28+
(dolist (value '("1" "true" "yes" "on" "TRUE"))
29+
(let ((star.observability::*observability-enabled* value))
30+
(is (star.observability:observability-enabled-p)))))
2431

2532
(test disabled-addon-costs-nothing
2633
"When the addon was never loaded (no exporter thread), the signal API is a

0 commit comments

Comments
 (0)