/trpc-opentelemetry-middleware

Instrument your TRPC Application with OpenTelemetry

Primary LanguageTypeScriptApache License 2.0Apache-2.0

TRPC OpenTelemetry Middleware

Trace your TRPC Applications. If you don't use OpenTelemetry yet please see The Baselime Docs

TRPC Tracing

Installation

npm i @baselime/trpc-opentelemetry-middleware

Setup

Add the Middleware to the procedures you want to trace

// trpc.ts
import { tracing } from "@baselime/trpc-opentelemetry-middleware";

const t = initTRPC.context<typeof createTRPCContext>().create({
  ...
});

// add the middleware to all the procedures you want to trace
export const publicProcedure = t.procedure.use(tracing({ collectInput: true }))