Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Need help in propagate context with exporter #1525

Open
HeenaBansal20 opened this issue Mar 6, 2025 · 0 comments
Open

Need help in propagate context with exporter #1525

HeenaBansal20 opened this issue Mar 6, 2025 · 0 comments

Comments

@HeenaBansal20
Copy link

HeenaBansal20 commented Mar 6, 2025

I have three php services running on different ports.
service1 service2 and service3 .
When I do curl to service1 , I can see that trace context is propagating from service1 to service3.
Service 1 received response from Service 2: Service 2 received response from Service 3: Hello from Service 3!

However when I am using exporter , I don't see it happening. Do I need to propagate context manually when using exporters?

<?php
    $traceprovider = \OpenTelemetry\API\Globals::tracerProvider();
    $tracer = $tracerProvider->getTracer('test');
    $root = $tracer->spanBuilder('root')->startSpan();
    $scope = $root->activate();

    $address = "localhost:8004/service1.php";
    $ch = curl_init();
    $url = "http://$address";
    curl_setopt($ch, CURLOPT_URL, $url);
    curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
    curl_exec($ch);
    curl_close($ch);
    $root->end();
    $scope->detach();
    $tracerProvider->shutdown();
?>
@HeenaBansal20 HeenaBansal20 changed the title unable to propagate context within services Need help in propagate context with exporter Mar 6, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant