Telemetry
sluice sends; the host decides where it goes. Nothing reads telemetry back: the queue never depends on it.
What sluice sends
Section titled “What sluice sends”-
Off unless asked: the host’s
[telemetry], in~/.config/sluice/config.toml, turns it on withsend = true. A command’s own--otel, orSLUICE_OTEL=1(ortrue,yes,on), turns it on for that command alone, and--otel=falseorSLUICE_OTEL=0turns it off for that command, whatever the table says. -
Off again, by the table or by OpenTelemetry’s own settings. The table’s
traces = false,metrics = falseorlogs = "off"turns that signal off, and no variable turns it on again.OTEL_SDK_DISABLED=trueleaves telemetry off as if it were never asked for: nothing is sent, and a run’s checks get nothing of it.OTEL_TRACES_EXPORTER=noneturns traces alone off: metrics and logs still go, and a run’s checks get the setting and noTRACEPARENT.OTEL_METRICS_EXPORTER=noneandOTEL_LOGS_EXPORTER=nonedo the same for theirs. A setting only turns a signal off: any other value,otlpamong them, leaves it as the table has it. -
Where: OTLP over plain HTTP, protobuf, to the table’s
collector, at its/v1/traces,/v1/metricsand/v1/logs. A table that names one takes none of the caller’sOTEL_EXPORTER_OTLP_*: an agent’s session that sets them for its own tools never sends sluice’s telemetry elsewhere, or with its headers. sluice refuses a table withsend = trueand nocollector. With no table, or where a command’s own--otelsends beside a table that names nocollector,OTEL_EXPORTER_OTLP_ENDPOINTnames it, by defaulthttp://localhost:4318. No TLS: something on the host receives it and forwards it. -
As: service
sluice, or the table’sservice, withservice.versionthe release’s andhost.namethe host’s own name. The table’sattributesadd the host’s own, e.g."deployment.environment" = "prod", and ahost.namethere names the host in sluice’s place. A command’s--otel-service-nameorSLUICE_OTEL_SERVICE_NAMEnames the service for that command. With no table, the standardOTEL_RESOURCE_ATTRIBUTESadds the host’s own instead; with one, sluice reads it not at all. -
Traces: one per round of a branch,
sluice.round, withsluice.recover,sluice.decideandsluice.performbeneath it, andsluice.form,sluice.start,sluice.verdict,sluice.blameandsluice.landbeneath those. Attributes:sluice.branch,sluice.submissions,sluice.candidate(the revision tested),sluice.executor,sluice.confined,sluice.outcome,sluice.ran,sluice.replayed. -
A command inside its caller’s trace: a command started with a W3C trace context in
TRACEPARENT, andTRACESTATEwhere given, as an agent program hands the commands it runs, sends one span in that trace while traces go, beneath the caller’s span. It is named by the command’s words assluice --helplists them,sluice submit,sluice execorsluicefor the home view, and holdssluice.exit, the command’s exit. A command started under none sends no span of its own. A round stays a trace of its own whatever command waits on it, and sluice’s host process keeps no caller’s context. -
A submission keeps its caller’s trace: its record holds the
TRACEPARENTits submit was started under astrace, whether or not the submit sends telemetry. Eachsluice.startandsluice.verdictspan of a combination that holds it links to that context, the link holdingsluice.submission, so a backend leads from an agent’s wait to the rounds that tested its work. A pull request’s submission keeps none. -
An exec’s span:
sluice execstarted under a caller’s context holdssluice.branch,sluice.ranandsluice.replayed, and beneath it asluice.checkspan for each check its run ran, over the times its runner gave, withsluice.taskandsluice.outcome,passorfail. A check answered from an earlier run has none. A command after--is its run’s one check, named by its words with whatever reads as a secret[redacted]. The run’s checks getTRACEPARENTnaming the exec’s span, as a round’s run names itssluice.start. -
A caller’s trace turns nothing on: it says only where sluice’s spans nest. Whether sluice sends is the command’s own choice, else the table, as above.
-
A submission’s life: while traces go, the write that ends a submission sends one span,
sluice.submission, from its submission to that end: landed,refused, blamed (failed), dropped for a conflict (conflict) orwithdrawn, whichever host or command wrote it. It is in the trace the submission was submitted under, beneath the caller’s span its record kept, or the root of a trace of its own where it kept none, and it links to the span of the round or command that ended it. It holdssluice.repository,sluice.branch,sluice.submission(its number),sluice.head,sluice.work,sluice.agent,sluice.outcome, its seconds waiting with no combination of it under test,sluice.waited_seconds, and under test,sluice.tested_seconds, andsluice.no_outcome, the runs of its combinations that decided nothing. Only a blame is an error: a run with no outcome is named, and is never the submission’s failure. A submission’s record keeps its time under test,under_test_msandunder_test_since, andruns_with_no_outcome, whether or not telemetry is on; nothing sluice decides reads them. -
Metrics, each with
sluice.repositoryandsluice.branch, andsluice.outcomewhere the table names it, and nothing else, so no metric carries a value that grows with each run.sluice.repositoryis the owner and name of the repository’sorigin,acme/appforgit@github.com:acme/app.gitorhttps://github.com/acme/app, else the repository’s folder’s name,.gitdropped; nothing else of the origin’s address is kept:Metric Kind What sluice.queue.depthgauge submissions not yet out of the queue sluice.windowgauge combinations the branch tests at once sluice.verdictscounter results read, by sluice.outcomesluice.tasks.ran,sluice.tasks.replayedcounter tasks run, and answered from the cache sluice.tasks.time_savedcounter, seconds, declared in sthe time each replayed task’s key last took when it ran sluice.culpritscounter submissions blamed for a failure sluice.conflictscounter submissions removed for a conflict sluice.landed,sluice.refusedcounter submissions landed; landings refused because the branch moved sluice.submission.landed_afterhistogram, seconds, declared in ssubmit to landed sluice.candidate.tested_forhistogram, seconds, declared in sa combination’s time under test, by sluice.outcomesluice.submissions.endedcounter submissions ended, by sluice.outcome:landed,refused,failed,conflictorwithdrawnsluice.submission.waitedhistogram, seconds, declared in sa submission’s time waiting with no combination of it under test, by sluice.outcomesluice.submission.testedhistogram, seconds, declared in sa submission’s time under test, combinations that overlap counted once, by sluice.outcomesluice.host.runninggauge the host’s checks running for the branch, sent by sluice’s host process every three seconds, and 0 once after its last run sluice.host.boundgauge the host’s bound, the same on each branch’s row: read sluice.host.runningsummed over branches against its greatestsluice.run.waited_for_roomhistogram, seconds, declared in show long a run waited for room under the host’s bound, from its ask first refused to its hold -
Logs: a failed check’s output, and sluice’s own warnings and errors, under the span they were emitted in. The table’s
logs, or a command’s--otel-logs, says how much of a failure goes.offsends none, andsummarysends which task failed and where its output is kept.tailsends the output’s end, scrubbed of what reads as a secret, at mostlogs_tail_bytesof it. -
The checks inside a run: with telemetry on, a run gets the collector sluice sends to and the traces and logs it sends, and no metrics: its environment holds
OTEL_METRICS_EXPORTER=none, with a table or without, so a run’s tools send their spans and logs, which name the round that started them, and no metric names a run. moon runs with--otel, so its own traces arrive under the service it names itself. With a[telemetry], a run gets the table’s collector, or the caller’s where the table names none, and none of the caller’s otherOTEL_*. Each other signal sluice does not send goes to it asOTEL_<SIGNAL>_EXPORTER=none. With no table, a run gets sluice’sOTEL_*as they are, but for metrics. moon does not nest its spans under sluice’s: each carrieshost.name, the table’s attributes,sluice.trace_id,sluice.span_id,sluice.placeandsluice.revisionas resource attributes, so a search for the round’s trace id finds them.
What a host needs
Section titled “What a host needs”-
A receiver on
localhost:4318, OTLP/HTTP. It must listen on localhost: sluice’s sandboxed runs reach localhost and nothing else. -
A
[telemetry]table in the host’s own settings,~/.config/sluice/config.toml, that sends to it and names what the host adds:[telemetry]send = truecollector = "http://localhost:4318"[telemetry.attributes]"deployment.environment" = "prod"On nix-darwin and NixOS, sluice’s module writes it from
services.sluice.settings.telemetry. Nothing goes in a session’s environment, and nothing wraps sluice: every command on the host reads the table, an agent’ssluice submitand sluice’s host process alike. The host process takes a change of the table up by handing its repositories to a fresh host process it starts itself, with nothing to restart. sluice names the host itself, so hosts sending to one backend stay apart. -
No secrets in sluice’s settings. An API key belongs to the receiver’s own configuration. sluice’s file names no headers, and a module may write it where every user can read it.
When nothing is listening, sluice loses its telemetry and carries on: a
refused connection costs nothing. A receiver that accepts and never
answers delays each sluice step’s exit by up to the exporter’s
timeout, 10 seconds.
Receivers
Section titled “Receivers”A viewer on a developer’s machine, keeping nothing once it is closed; one of these at a time, since both take port 4318:
nix run nixpkgs#otel-tui # in a terminalnix run nixpkgs#otel-desktop-viewer # in a browserAny OpenTelemetry collector, or an agent with an OTLP receiver on localhost, forwards to a backend over TLS itself. The repository’s docs/telemetry.md has the receiver configurations.