T
tRPC

tRPC + Express + Open Telemetry

tRPC + Express + Open Telemetry

PPatrickJ6/27/2023
I'm wondering if anyone has experience using tRPC in conjunction with Express and Open Telemetry. I've noticed that the tRPC request handler is labeled as "middleware - <anonymous>" while other routes are labeled as "request handler - /path/to/handler". Can anyone shed some light on this?
IItsWendell8/29/2023
Not sure how you're binding TRPC to Express, but most likely as a middleware, and it probably doesn't have a specific path. You should be able to overwrite the span name possibly with e.g. an trpc middleware.
PPatrickJ8/29/2023
Yep that was something like that
IItsWendell8/29/2023
@patrickj7332 Been working on adding OTEL Traces + Logging to my TRPC service on cloudflare workers, it's pretty nice, found this just to see if any packages or something exists for adding TRPC specific spans to the traces but doesn't seem so, so added some basic stuff myself, primarily wrote a trpc middleware that makes sure that each procedure is in it's own span so that batched requests are visualized properly.
PPatrickJ8/30/2023
Wow that sounds awesome! Please cosinder open sourcing this
IItsWendell9/20/2023
@PatrickJ there's an open telemetry library in the discord of Cloudflare, other than that the middleware is pretty simple, I've a pretty busy weeks ahead but I'll try to share something soon, if I don't feel free to DM me to remind me 😉

Looking for more? Join the community!

T
tRPC

tRPC + Express + Open Telemetry

Join Server
Recommended Posts
Strange trpc typesHello, I just installed a fresh `trpc` project with `prisma` and `next`. I have a prisma schema suchIs there a version of tRPC v10 that works with Next 12?Hi, is there a version of tRPC that works with Next 12 and React 17? We want to incrementally adoptRunning TRPC on Vercel with custom serialization failsHi all, I'm having some difficulties with the serialization of my objects when I run on vercel. I'm How to prefetch data on the client into the cache?To simplify a bit, lets say I'm making an app that allows users to view a project. I have a top leveIt's possible to upload a zip file through trpc?I'm doing a screen where I need to upload a zip with pdfs files, it is possible with trpc? or I needroute needs jwt but it doesn'thi i do have a public route but when i i call it on the front end it requires a jwt token SERVER imcall socket.io events from inside trpc endpoints?how do i implement notifications when someone likes a post with socket.io? will every user have his Prefetch on useContext() is not being picked up by react-query.I need to prefetch one of my procedures to pre-load data for a page that the user can navigate to. Thow do you consume trpc endpoints from postman?I'm currently trying to set up testing for a full stack project while using trpc. but im unsure how tRPC 10 Mutations Firing Twice in Deployed Releases OnlyWe have a newly-upgraded tRPC 10 / ReactQuery 4 app and on two pages on which we have a lot of mutatuseQuery with query paramsHi, I'm wondering how to correctly handle query params as a useQuery input using Nextjs. ``` const infiniteQuery always undefined cursorHey there ! I'm struggling a bit to understand who the `useInfiniteQuery` is supposed to work with