VIP-72: Experimental.Otlp: logs, metrics and traces over OTLP, scrubbed and bounded
Status: accepted by Will, 2026-11-23 — standard library only (no compiler or language changes). Will: "58 I accept. I accept every other language proposal but ones that don't require a change to the language and are purely library functions that don't require compiler changes at all should be marked as such". Implementation in progress (Experimental.Otlp and Experimental.Logger).
Will's words
Ok so give me a list of [the reference engine's] features. We need to figure out what the VIP should look like. Some of the features outside of durable execution likely should simply be in the standard library I'm guessing but we should enumerate all of them
Summary
One sentence. Logging, metrics and tracing are Effect's and already in scope, Effect's own OTLP exporter already compiles in Vibe 0.0.13, and Experimental.Otlp adds the three things an agentic program needs on top: redaction, a bounded transport that counts what it drops, and a copy of each run's logs in its journal.
One paragraph. This is the smallest VIP in the set, and it says so. A Vibe program already writes try logInfo(…), try withSpan(effect { … }, "name") and Metric.counter(…), and provide Otlp.layerJson({ baseUrl, resource }) already sends all three to a collector. The observability package of the reference engine (an existing Effect durable-execution framework these built-ins are modelled on) composes that same exporter "with the journal's redaction rules", so a credential in a log line never leaves the process, and bounds the transport so telemetry cannot grow without limit. It allocates no OpenTelemetry SDK and resolves no node: built-in, so it runs unchanged on Node, on Bun and in a browser. This VIP ports that composition. Telemetry describes a run; it is never the run's record, and losing it never fails a step.
try logInfo("triage started") ─┐
try withSpan(effect { … }, "triage") ├─► Effect's Logger, Tracer, Metric ─► Experimental.Otlp.layer ─► scrub ─► batch ─► collector
Metric.counter("issues_labeled") ─┘ │ over the size cap: drop, count, warn once a minute
└─► Experimental.Logger.journal ─► the run's journalDecision
// proposed
export effect function triage() {
provide Experimental.Otlp.layer({ url: "http://localhost:4318", service: "triage" }) {
try withSpan(logInfo("triage started"), "triage")
}
}The same program compiles under vibelang 0.0.13 today with Effect's exporter, unscrubbed and unbounded:
export effect function triageToday() {
provide Otlp.layerJson({ baseUrl: "http://localhost:4318", resource: { serviceName: "triage" } }) {
try withSpan(logInfo("triage started"), "triage")
}
}Module
Two additions, each named after the Effect module it extends, as VIP-33 rules. Both are in scope with no import, and their code is vibelang-runtime/experimental/Otlp and …/Logger. They port the reference engine's observability package. Logger, Tracer, Metric, Otlp, OtlpTracer, OtlpLogger, OtlpMetrics and PrometheusMetrics stay Effect's.
| Call | Meaning | Reference engine |
|---|---|---|
Experimental.Otlp.layer({ url, service, version?, attributes?, headers? }) | A layer that exports logs, metrics and traces over OTLP/HTTP, scrubbed and bounded | Otlp.layerFetch, Resource |
Experimental.Otlp.relay(options) | An HTTP handler that receives a browser's OTLP exports on your own route | OtlpRelay.serve |
Experimental.Otlp.dropped | The counter of discarded batches | flows_observability_otlp_dropped |
Experimental.Logger.journal | A layer that mirrors each log record of a durable run into that run's journal | JournalLogger |
Rules
- Removing the layer removes telemetry and changes nothing else. An export that fails never fails or retries the step that logged.
- Records are scrubbed before export. The rules are the journal's: a value shaped like a credential becomes
[REDACTED]. - A resource is validated when the layer is built. Identity fields and attribute keys hold at most 1,024 UTF-16 code units. A bad resource fails with
InvalidResourceConfiguration. - The transport is capped at 1 MiB a request. A batch over the cap is discarded, counted, and reported by one
Warnlog with codeotlp_export_discardedand a reason (oversized,stalledorsaturated), at most once a minute. The warning never enters the exporter. - Ambient resource configuration is ignored. An environment variable cannot enlarge a resource after it was validated.
- No SDK.
Experimental.Otlp.layeruses Effect's exporter andHttpClient. A host that wants the OpenTelemetry SDK imports the reference engine'sNodeOtelorBrowserOtelfrom npm. - What the standard library emits. Every module in this set records spans and metrics for its own work: a span per durable step, per model call with token usage, per tool call. A failed span carries its failure's tag and code, never its message. A metric label is a bounded vocabulary: a run id is never a label. A replayed step is not counted as a new model call. Effect's
Telemetrymodule ineffect/aialready defines the model-call attributes, and the reference engine'sRunMetricsin its flow package defines the run and step metrics. - Content is off by default. Prompts, completions, file contents and shell output are not exported. Turning them on is a separate, named option, not a log level.
Host needs
HttpClient. Experimental.Logger.journal also needs the journal, which std-durable provides.
Maintainers' decisions
This record comes from the 2026-11-09 built-in set review. The Status line above records Will’s subsequent ruling.
- The same program compiles under
vibelang0.0.13 today with Effect's exporter, unscrubbed and unbounded: Design · Review. - Two additions, each named after the Effect module it extends, as VIP-33 rules. Design · Review.
- Both are in scope with no import, and their code is
vibelang-runtime/experimental/Otlpand…/Logger. Design · Review. - They port the reference engine's observability package. Design · Review.
Logger,Tracer,Metric,Otlp,OtlpTracer,OtlpLogger,OtlpMetricsandPrometheusMetricsstay Effect's. Design · Review.- Call
Experimental.Otlp.layer({ url, service, version?, attributes?, headers? }): Meaning: A layer that exports logs, metrics and traces over OTLP/HTTP, scrubbed and bounded; Reference engine:Otlp.layerFetch,Resource. Design · Review. - Call
Experimental.Otlp.relay(options): Meaning: An HTTP handler that receives a browser's OTLP exports on your own route; Reference engine:OtlpRelay.serve. Design · Review. - Call
Experimental.Otlp.dropped: Meaning: The counter of discarded batches; Reference engine:flows_observability_otlp_dropped. Design · Review. - Call
Experimental.Logger.journal: Meaning: A layer that mirrors each log record of a durable run into that run's journal; Reference engine:JournalLogger. Design · Review. - Removing the layer removes telemetry and changes nothing else. An export that fails never fails or retries the step that logged. Design · Review.
- Records are scrubbed before export. The rules are the journal's: a value shaped like a credential becomes
[REDACTED]. Design · Review. - A resource is validated when the layer is built. Identity fields and attribute keys hold at most 1,024 UTF-16 code units. Design · Review.
- A bad resource fails with
InvalidResourceConfiguration. Design · Review. - The transport is capped at 1 MiB a request. A batch over the cap is discarded, counted, and reported by one
Warnlog with codeotlp_export_discardedand a reason (oversized,stalledorsaturated), at most once a minute. Design · Review. - The warning never enters the exporter. Design · Review.
- Ambient resource configuration is ignored. An environment variable cannot enlarge a resource after it was validated. Design · Review.
- No SDK.
Experimental.Otlp.layeruses Effect's exporter andHttpClient. Design · Review. - A host that wants the OpenTelemetry SDK imports the reference engine's
NodeOtelorBrowserOtelfrom npm. Design · Review. - What the standard library emits. Every module in this set records spans and metrics for its own work: a span per durable step, per model call with token usage, per tool call. Design · Review.
- A failed span carries its failure's tag and code, never its message. Design · Review.
- A metric label is a bounded vocabulary: a run id is never a label. Design · Review.
- A replayed step is not counted as a new model call. Design · Review.
- Effect's
Telemetrymodule ineffect/aialready defines the model-call attributes, and the reference engine'sRunMetricsin its flow package defines the run and step metrics. Design · Review. - Content is off by default. Prompts, completions, file contents and shell output are not exported. Design · Review.
- Turning them on is a separate, named option, not a log level. Design · Review.
HttpClient. Design · Review.Experimental.Logger.journalalso needs the journal, which std-durable provides. Design · Review.
Adopted review answers
- Keep
Experimental.Xnames under VIP-33. Promotion to a bare module name requires a later decision. Review question 1.
Compared
The same program in the reference engine 1.x. It type-checks against the reference engine's observability package 1.0.0-rc.16.
import { Otlp } from "@smthrs/observability"
import { Effect } from "effect"
const Telemetry = Otlp.layerFetch({ baseUrl: "http://localhost:4318", serviceName: "triage" })
export const program = Effect.logInfo("triage started").pipe(
Effect.withSpan("triage"),
Effect.provide(Telemetry)
)| Program | Tokens (o200k_base) | Lines |
|---|---|---|
| Vibe, proposed | 51 | 5 |
Vibe 0.0.13 today, with Effect's Otlp.layerJson | 58 | 5 |
| Reference engine 1.x | 83 | 9 |
Checked. Both Vibe examples use only existing syntax. The second compiles under vibelang 0.0.13 with nothing declared: Otlp, withSpan and logInfo are Effect's. The first compiles against a declaration of Experimental.Otlp.layer. The reference engine program type-checks as shown.
Principles
- TypeScript-first. A layer.
- Effect-second. The strongest case in the set. Logging, tracing, metrics and the exporter are Effect's. This VIP adds a composition, not a system.
- Optimized for agentic programs. A prompt and a tool result are the largest log lines a program writes and the likeliest to hold a secret. Scrubbing and a size cap are the two properties an agent's telemetry needs.
- Highly forkable. A fork adds an exporter by providing a layer.
- Factory-first. Published run records can include prompts, model calls, tool calls and decisions.
Experimental.Logger.journaladds the run’s logs to its journal.
What this changes
Experimental.OtlpandExperimental.Loggerare new, with four exports between them. No grammar changes.- The banned
consoleglobal (VIP-33) keeps its replacement:log,logInfoandConsole.
Alternatives
- Add nothing. Effect's
Otlp.layerJsonworks today. A program then exports whatever it logs, unscrubbed and unbounded. For an agentic program that is the failure this module exists to prevent. - One module named
Observe. A fifth name besideOtlp,Logger,TracerandMetric. VIP-33 names an addition after the Effect module it extends, and each of these two extends one. - The OpenTelemetry SDK as the default. It pulls
async_hooksand cannot bundle for a browser. The reference engine keeps it at a separate subpath for that reason. - A
traceorspankeyword.withSpanis one call, andEffect.fn("name")already names a function's span.
Follow-up questions
- Scrubbing upstream. Redaction before export belongs in Effect's exporter. Recommendation: propose it to Effect and retire
Experimental.Otlp.layerwhen it lands. - Span and metric names. Rule 7 defers the table. The reference engine's names today carry a prefix named after the engine and a
flows_prefix. Should Vibe's standard library keep them, so the reference engine's dashboards work, or rename tovibe_? Recommendation: keep the reference engine's names; a rename breaks every existing dashboard for no gain. - A local sink when the collector is down. The drop warning goes to the program's own logger. Is that enough for a headless host? Recommendation: yes for the first release; the counter is the durable signal.
Depends on
- Nothing in this set.
Experimental.Logger.journaltakes the journal as a requirement.