opencensus-node
opencensus-node copied to clipboard
Please add an example of trace propagation.
I've been trying to figure out how to do trace propagation between micro-services and have been unable to figure out the api. An example will solve this for me. The example would ideally contain two running services, one to create a root span, ping the other service and propagate trace headers through the request, and for the child span to pick up the remote parent. I'd also like to see the ability to selectively create root or child spans based on the presence of the request headers in the second service.
I think documentation also needs work around this, but an example is quicker and probably easier right now.
@thekemkid Thanks for asking this! I think https://github.com/census-instrumentation/opencensus-node/tree/master/examples/express and https://github.com/census-instrumentation/opencensus-node/tree/master/examples/http examples should give you some idea about trace propagation across multiple services. Let me know if this helps/
At the risk of shameless self-promotion - you can see working examples of context propagation here, albeit in Golang:
https://github.com/yuriatgoogle/opencensus-demo/tree/master/go/http