Otlp.layerFromConfig exports nothing when only OTEL_EXPORTER_OTLP_ENDPOINT is set

Cerrado
#10,231 0 comentarios 0 reacciones 1 asignado Ver en GitHub

Los mantenedores suelen responder en 1 día

@effect-bot ya está trabajando en esto.

Desde el 31/10/2026.

  • #10232 de @schutzelaars — abierto

Evaluación

Este issue todavía no se ha evaluado.

Descripción

What version of Effect is running?

4.1.1 (same code on main at 6b70da9d05f4915552e2471ed3266b3ddeda3184)

What steps can reproduce the bug?

Otlp.layerFromConfig installs no exporter unless OTEL_TRACES_EXPORTER, OTEL_METRICS_EXPORTER
or OTEL_LOGS_EXPORTER is set to otlp. With only an endpoint and a service name, the setup the
OpenTelemetry docs show, the layer builds and nothing is sent. The signal layerFromConfigs in
OtlpTracer, OtlpLogger and OtlpMetrics behave the same.

npm install [email protected]
OTEL_EXPORTER_OTLP_ENDPOINT=http://127.0.0.1:14318 OTEL_SERVICE_NAME=repro node repro.mjs
// repro.mjs
import * as Http from "node:http"
import { Effect, Layer, Metric } from "effect"
import { FetchHttpClient } from "effect/http"
import { Otlp, OtlpExporter, OtlpSerialization } from "effect/observability"

const received = []
const server = Http.createServer((request, response) => {
  received.push(`${request.method} ${request.url}`)
  request.resume()
  request.on("end", () => response.end("{}"))
})
await new Promise((resolve) => server.listen(14318, "127.0.0.1", resolve))

await Effect.runPromise(
  Effect.gen(function*() {
    yield* Effect.log("hello")
    yield* Metric.update(Metric.counter("repro_counter"), 1)
    yield* Effect.void.pipe(Effect.withSpan("repro-span"))
    yield* (yield* OtlpExporter.Flusher).flush
  }).pipe(
    Effect.provide(
      Otlp.layerFromConfig().pipe(
        Layer.provide(OtlpSerialization.layerJson),
        Layer.provide(FetchHttpClient.layer)
      )
    )
  )
)

server.close()
console.log(`requests received: ${received.length}`)
for (const line of received) console.log(`  ${line}`)
What is the expected behavior?

Logs, metrics and traces are exported. The OpenTelemetry spec defaults all three
OTEL_*_EXPORTER variables to otlp
(spec).
The JS Node SDK
(create-from-env.ts)
and Go's autoexport
(signal.go)
export with the same variables.

What do you see instead?
requests received: 0

Adding OTEL_TRACES_EXPORTER=otlp gives POST /v1/traces only. Nothing logs a warning.

Additional information

The default is [] in
internal/otlpEnv.ts#L33-L36,
and each signal checks exporters.includes("otlp")
(OtlpTracer.ts#L182).
It dates from Effect-TS/effect-smol#2325 and no test asserts it. The JSDoc doesn't mention the
requirement.

Changing the default to ["otlp"] fixes it. none keeps working through the existing check.
Users who set an endpoint but relied on the missing variable to keep export off would start
exporting, and would set OTEL_*_EXPORTER=none instead. I can open a PR.

I investigated this with an AI coding agent, Claude Code. The agent read the Effect sources,
wrote the repro, and ran it. I reviewed the analysis before filing.

Lenguaje dominante
TypeScript
Estrellas
16.7k
Forks
808
Merge medio
11 h 31 min
PR fusionados (30 d)
834

Preparar el entorno

Este proyecto no incluye contenedor de desarrollo, Dockerfile ni guía de contribución, así que la configuración corre por tu cuenta: empieza por su README y consulta nuestra guía para la primera contribución para los pasos generales.

Primeros pasos

  1. Lee el issue completo y luego la guía de contribución del proyecto.
  2. Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
  3. Haz un fork del repositorio y trabaja en una rama.
  4. Abre un pull request que haga referencia al número del issue.

Más de Effect-TS/effect

Todos los issues de Effect-TS/effect

Issues similares

Más issues de TypeScript

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.