-
Notifications
You must be signed in to change notification settings - Fork 284
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
CP-48195: Split tracing
library to avoid future cyclic dependencies
#5551
CP-48195: Split tracing
library to avoid future cyclic dependencies
#5551
Conversation
97f0194
to
874ffc8
Compare
ocaml/forkexecd/lib/forkhelpers.ml
Outdated
@@ -357,10 +362,12 @@ let execute_command_get_output_inner ?env ?stdin ?(syslog_stdout = NoSyslogging) | |||
) | |||
(fun () -> List.iter Unix.close !to_close) | |||
|
|||
let execute_command_get_output ?env ?(syslog_stdout = NoSyslogging) | |||
let execute_command_get_output ?traceparent ?env ?(syslog_stdout = NoSyslogging) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is traceparent
written this way in other code already? Otherwise I would prefer a better spelling.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There are some places that call the parent span traceparent
, some that call it parent
, some that call it tracing
. Given the function used is called with_tracing
is it more preferable to call it tracing
?
ocaml/forkexecd/lib/forkhelpers.ml
Outdated
@@ -357,10 +362,12 @@ let execute_command_get_output_inner ?env ?stdin ?(syslog_stdout = NoSyslogging) | |||
) | |||
(fun () -> List.iter Unix.close !to_close) | |||
|
|||
let execute_command_get_output ?env ?(syslog_stdout = NoSyslogging) | |||
let execute_command_get_output ?traceparent ?env ?(syslog_stdout = NoSyslogging) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is traceparent
written this way in other code already? Otherwise I would prefer a better spelling.
ocaml/libs/tracing/tracing.mli
Outdated
module Attributes : sig | ||
type 'a t | ||
|
||
val fold : (string -> 'a -> 'b -> 'b) -> 'a t -> 'b -> 'b |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This smells funny. We have a new abstract type 'a t
that has no way to create or observe it.
031bce8
to
ac1baee
Compare
forkhelpers.ml
with dttracing
library to avoid future cyclic dependencies
bcc563a
to
ee9906b
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Commits need to be squashed before merging
Attempts to split the tracing library into components and exporter parts. While trying to instrument `forkhelpers.ml` with tracing, I found a cycle dependency: `Tracing(Exporter)` -> `Open_uri` -> `Stunnel` -> `Forkhelpers`. This splits the tracing library between exporting functionality and components. Signed-off-by: Gabriel Buica <[email protected]>
Small improvements to `tracing_export.ml` and `tracing_exoprt.mli`. Issues found while splitting the library such as: missing documentation and small code refactoring for better readability. Signed-off-by: Gabriel Buica <[email protected]>
Adds `with_tracing` helper function to `forkhelpers.ml`. This is to show that there are no more cycle dependecies between `tracing` library and `forexecd` and it will be used in a follow-up PR to instrument `forkhelpers` with tracing. Signed-off-by: Gabriel Buica <[email protected]>
ee9906b
to
d049d43
Compare
BVT 197315 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
bvt passed
This PR is meant to split the
tracing
library in 2 parts:tracing.ml
that represents the core of the library;tracing_export.ml
that creates and manages the exporter thread.This is to avoid cyclic dependencies between
tracing
andforkexecd
.Instrumentation of
forkexecd
will be done as a follow-up PR.