@vight/hono

Hono

Add Vight request spans to Hono apps with the @vight/hono middleware and @vight/node runtime.

HonoNode.jsMiddleware

Integration model

@vight/hono adds request spans at the middleware layer while @vight/node provides runtime startup and export. Start the runtime package first, then register the middleware before route handlers so inbound requests include route and status context.

The middleware belongs near the top of the Hono stack. Place it before application routes so every handled request receives consistent span attributes and can correlate with logs emitted during the request.

Install

Terminal
npm install @vight/node @vight/hono hono

Register middleware

server.ts
import { Hono } from "hono";
import { serve } from "@hono/node-server";
import { startVight } from "@vight/node";
import { vightHono } from "@vight/hono";

await startVight({
  serviceName: "api",
  environment: "production",
});

const app = new Hono();

app.use("*", vightHono());

app.get("/", (c) => c.text("ok"));

serve(app);

The middleware creates request spans and tags method, route, path, status, host, and user agent. Start @vight/node before serving requests so spans can export with the expected project and service identity.