Skip to content

fix(nitro): print client ingest events to stdout - #821

Merged
HugoRCD merged 1 commit into
mainfrom
EVL-532/print-client-ingest-events
Oct 10, 2026
Merged

HugoRCD merged 1 commit into
mainfrom
EVL-532/print-client-ingest-events

Conversation

@evlogai

@evlogai evlogai Bot commented Oct 10, 2026

Copy link
Copy Markdown
Contributor

Fixes #812 (Linear EVL-532).

Problem

The client ingest endpoint (_evlog/ingest.post.ts) accepts browser log events, runs the enrich hooks and sends the event to drains. It never writes the event to the console, unlike server events, which go through outputWideEvent. An app that has no drain configured therefore answers 204 to every client log and the event goes nowhere.

Fix

After enrichers have run, the route calls the existing outputWideEvent(wideEvent), then runs the drains as before. This is the same order emitWideEvent uses for server events, so the console carries the same event the drains receive. silent: true still suppresses the output, and pretty / stringify are honored.

Evidence

Regression test first: packages/evlog/test/nuxt/ingest-output.test.ts, run against the code before the fix:

FAIL  prints a client event to stdout when no drain is configured
AssertionError: expected "info" to be called 1 times, but got 0 times
FAIL  prints a client error to stdout through the error console method
AssertionError: expected "error" to be called 1 times, but got 0 times
FAIL  prints a client event and still runs the drain hook
AssertionError: expected "info" to be called 1 times, but got 0 times
Tests  3 failed | 1 passed (4)

After the fix:

ingest-output.test.ts + ingest-sampling.test.ts:  Tests 8 passed (8)
full packages/evlog suite:                        Test Files 101 passed (101), Tests 2046 passed (2046)
pnpm run lint:                                    exit 0
pnpm run typecheck:                               exit 0

The checks ran in the sandbox on this branch. The regression is a unit test that drives the route through h3 with useNitroApp mocked; I did not run it inside a live Nuxt app, so that end-to-end path is unverified.

Not in this PR

  • No docs note or evlog doctor warning for apps without a drain. Those can follow if wanted.
ELI5

When a website sends a log to the server, the server accepted it but only forwarded it to a log service. If the app had no such service set up, the log was thrown away silently. Now the server also prints the log to its console, the same way it does for its own logs. Nothing else changes: the log still goes to the service when one is set up.

The client ingest endpoint sent accepted events only to drains, so an app
without a drain returned 204 and the browser log never appeared anywhere.
Write each accepted event to the console after enrichers run, matching
server events, then run the drains as before.
@evlogai
evlogai Bot requested a review from HugoRCD October 10, 2026 22:09
@vercel

vercel Bot commented Oct 10, 2026 •

Copy link
Copy Markdown
Contributor

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated
evi Ready Ready Preview Oct 10, 2026 10:10pm UTC
evlog-docs Ready Ready Preview, v0 Oct 10, 2026 10:10pm UTC
evlog-render-lab Ready Ready Preview Oct 10, 2026 10:10pm UTC
evlog-telemetry Building Building Preview Oct 10, 2026 10:10pm UTC
just-use-evlog Ready Ready Preview Oct 10, 2026 10:10pm UTC

Request Review

@coderabbitai

coderabbitai Bot commented Oct 10, 2026

Copy link
Copy Markdown
Contributor

Important

Review skipped

Bot user detected.

To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration
  • Configuration used: defaults
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 287909fc-0955-4271-8dcb-a17495b2b49b

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@github-actions github-actions Bot added the bug Something isn't working label Oct 10, 2026
@github-actions

Copy link
Copy Markdown
Contributor

Thank you for following the naming conventions! 🙏

@pkg-pr-new

pkg-pr-new Bot commented Oct 10, 2026

Copy link
Copy Markdown
@evlog/cli

npm i https://pkg.pr.new/@evlog/cli@821

evlog

npm i https://pkg.pr.new/evlog@821

@evlog/nuxthub

npm i https://pkg.pr.new/@evlog/nuxthub@821

@evlog/signals

npm i https://pkg.pr.new/@evlog/signals@821

@evlog/telemetry

npm i https://pkg.pr.new/@evlog/telemetry@821

commit: 1810e6c

@HugoRCD
HugoRCD merged commit 6887f13 into main Oct 10, 2026
18 of 19 checks passed
@HugoRCD
HugoRCD deleted the EVL-532/print-client-ingest-events branch October 10, 2026 22:11

This branch was successfully deployed

5 active deployments
Preview – evlog-telemetry — 1810e6c5 Deployed Oct 10, 2026 by vercel[bot]
Preview – evi — 1810e6c5 Deployed Oct 10, 2026 by vercel[bot]
Preview – evlog-docs — 1810e6c5 Deployed Oct 10, 2026 by vercel[bot]
Preview – evlog-render-lab — 1810e6c5 Deployed Oct 10, 2026 by vercel[bot]
Preview – just-use-evlog — 1810e6c5 Deployed Oct 10, 2026 by vercel[bot]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Client ingest events are silently lost in production when no drain is configured

1 participant