I'm pretty new to OpenTelemetry world.
We have a PHP backend and Node.js Express server for SSR. For starters we want to collect tracing data for some subset of the requests. So, when a request comes to PHP server it calculates some chances, and if it is true it starts collecting tracing data from PHP side. Then comes to a point that it makes a HTTP request to Express server to render some JS and HTML. And the option of if the tracing is enabled or not is passed to Express server endpoint via PHP.
The problem: Tracing is setup since the beginning of the Express server, to track everything correctly. But the option to stop tracing or not, comes from backend to Express server in a route. So, when the route is invoked I need to check the body and decide to stop tracing or not.
I can't do it with samplers. Because like I said the decision to not send any tracing comes to the endpoint. Not since the beginning.
How can I stop the tracing and don't send anything? Even if some data were already collected.
from How to disable OpenTelemetry after it is initialized?
No comments:
Post a Comment