Skip to content

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 journal

Decision

// 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.

CallMeaningReference engine
Experimental.Otlp.layer({ url, service, version?, attributes?, headers? })A layer that exports logs, metrics and traces over OTLP/HTTP, scrubbed and boundedOtlp.layerFetch, Resource
Experimental.Otlp.relay(options)An HTTP handler that receives a browser's OTLP exports on your own routeOtlpRelay.serve
Experimental.Otlp.droppedThe counter of discarded batchesflows_observability_otlp_dropped
Experimental.Logger.journalA layer that mirrors each log record of a durable run into that run's journalJournalLogger

Rules

  1. Removing the layer removes telemetry and changes nothing else. An export that fails never fails or retries the step that logged.
  2. Records are scrubbed before export. The rules are the journal's: a value shaped like a credential becomes [REDACTED].
  3. 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.
  4. The transport is capped at 1 MiB a request. A batch over the cap is discarded, counted, and reported by one Warn log with code otlp_export_discarded and a reason (oversized, stalled or saturated), at most once a minute. The warning never enters the exporter.
  5. Ambient resource configuration is ignored. An environment variable cannot enlarge a resource after it was validated.
  6. No SDK. Experimental.Otlp.layer uses Effect's exporter and HttpClient. A host that wants the OpenTelemetry SDK imports the reference engine's NodeOtel or BrowserOtel from npm.
  7. 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 Telemetry module in effect/ai already defines the model-call attributes, and the reference engine's RunMetrics in its flow package defines the run and step metrics.
  8. 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 vibelang 0.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/Otlp and …/Logger. Design · Review.
  • They port the reference engine's observability package. Design · Review.
  • Logger, Tracer, Metric, Otlp, OtlpTracer, OtlpLogger, OtlpMetrics and PrometheusMetrics stay 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 Warn log with code otlp_export_discarded and a reason (oversized, stalled or saturated), 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.layer uses Effect's exporter and HttpClient. Design · Review.
  • A host that wants the OpenTelemetry SDK imports the reference engine's NodeOtel or BrowserOtel from 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 Telemetry module in effect/ai already defines the model-call attributes, and the reference engine's RunMetrics in 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.journal also needs the journal, which std-durable provides. Design · Review.

Adopted review answers

  • Keep Experimental.X names 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)
)
ProgramTokens (o200k_base)Lines
Vibe, proposed515
Vibe 0.0.13 today, with Effect's Otlp.layerJson585
Reference engine 1.x839

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.journal adds the run’s logs to its journal.

What this changes

  • Experimental.Otlp and Experimental.Logger are new, with four exports between them. No grammar changes.
  • The banned console global (VIP-33) keeps its replacement: log, logInfo and Console.

Alternatives

  • Add nothing. Effect's Otlp.layerJson works 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 beside Otlp, Logger, Tracer and Metric. 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_hooks and cannot bundle for a browser. The reference engine keeps it at a separate subpath for that reason.
  • A trace or span keyword. withSpan is one call, and Effect.fn("name") already names a function's span.

Follow-up questions

  1. Scrubbing upstream. Redaction before export belongs in Effect's exporter. Recommendation: propose it to Effect and retire Experimental.Otlp.layer when it lands.
  2. 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 to vibe_? Recommendation: keep the reference engine's names; a rename breaks every existing dashboard for no gain.
  3. 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.journal takes the journal as a requirement.