open-telemetry / opentelemetry-php

The OpenTelemetry PHP Library
https://opentelemetry.io/docs/instrumentation/php/
Apache License 2.0
716 stars 178 forks source link

continue tracing in other microservice #1265

Closed vkoori closed 6 months ago

vkoori commented 6 months ago

in pacakge open-telemetry/opentelemetry-auto-laravel, when we request from microservice A to microservice B. we can track them but what happened on B side is in the new span so that this span has no reference to its parent request from microservice A.

I think a header should be set in Guzlle requests, and if that header is present in the header of received requests, it should be used as a span parentId.

brettmc commented 6 months ago

Hi. Yes, you need to instrument your HTTP client in microservice A so that the trace context is sent to microservice B. You can use https://packagist.org/packages/open-telemetry/opentelemetry-auto-guzzle to do that, if you're using guzzle.