-
Notifications
You must be signed in to change notification settings - Fork 395
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
[Question] spanning across sub-processes #250
Comments
btw for asyncio I found I could do it by serializing the parent span in the base process via: dd_span = tracer.get_call_context().get_current_span()
attrs = {'name', 'service', 'resource', 'span_type', 'trace_id', 'span_id', 'parent_id', 'start'}
dd_span_info = {n: getattr(dd_span, n) for n in attrs} if dd_span else None then smashing it in in the child process: try:
if dd_span_info:
dd_ctx = tracer.get_call_context()
parent_span = Span(tracer, **dd_span_info, context=dd_ctx)
dd_ctx._current_span = parent_span
task = asyncio.Task.current_task(loop=self._loop)
set_call_context(task, dd_ctx)
finally:
if dd_span_info:
set_call_context(task, None) This works because the tracer only needs a few key pieces of information. If we could formalize a process for this it would be awesome! |
hmm, reading http://pypi.datadoghq.com/trace/docs/#distributed-tracing it seems like perhaps the asyncio patchers should support parent trace/span IDs |
ok, I think I've implemented something acceptable in my PR: #248 It adds optional kwargs that follows the aiohttp style for distributed spans...however if there was a way to officially tell the context what the parent was it would be better I think. |
Related to #247 that has been solved. Closing this one too. |
In our application we have a process pool of botocore workers. Is there a way, in general, to ensure that sub-processes can chain up to their parent process traces?
I'm guessing the right context details needs to be transferred to the sub-process to make things work.
The text was updated successfully, but these errors were encountered: