geek / traci

hapi open tracing plugin
Mozilla Public License 2.0
5 stars 2 forks source link

Feature: Span across multiple services #2

Closed jagazee closed 4 years ago

jagazee commented 5 years ago

Feature Implementation: Wanted to check if the plugin could provide a feature where the spans could be traced across different micro-services. I want to create a set of spans under single trace for a user experience which internally call multiple services. Something like microservice A talks to B, so request to A initiates parent span and then the parent span context is passed to service B . Service B checks if there is a parent span context ( in hapi_request ) to use and proceed as "childof" span or creates a new span instead of childof.

geek commented 5 years ago

@jagazee this looks correct to me. The only missing parts are to fix the linting and add a test or two.

jagazee commented 5 years ago

Great thanks! Linting is fixed, trying to resolve the test failures.

jagazee commented 5 years ago

Hi, Linting is fixed, but having a hard time fixing the tests with lab and code. Is there a way to mock the span? Getting error due to request.spans() being undefined, although its being set.Can you please help list down the steps to debug the index.js. Thanks!