خرید بک لینک

Vote count: 0

I'm trying to figure out an appropriate method to carry a request-id (x-request-id from a restify request header) through my stack; across thrift inter-service calls, and with rabbitmq queue messages. The goal is that anywhere, in any service, I can correlate an error or event back to an initiating http request. Is there a known practice for doing this with Node? I'd like to avoid passing a context around through virtually every function call.

I've looked into the way New Relic handles instrumentation, and there's this blog: https://opbeat.com/blog/posts/how-we-instrument-nodejs/; but these types of instrumentation require hooking into tons of node core library calls, and don't really help with carrying the context across thrift calls.

How can I take a restify header id such as "x-request-id" from a request, and have access to it deeper in my stack (even in async callbacks) without modifying every function to pass the values through?

I'm also looking for a clean way to pass it through all thrift calls (getting it across service boundaries).

This is with TypeScript and Node.js 5.x

Thanks!

asked 26 secs ago

برچسب: نویسنده: استخدام کار تاريخ: چهارشنبه 25 فروردين 1395 ساعت: 8:38

صفحه بندی