Skip to content

Conversation

@GabrielBuica
Copy link
Contributor

@GabrielBuica GabrielBuica commented Apr 9, 2024

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 and forkexecd.

Instrumentation of forkexecd will be done as a follow-up PR.

@GabrielBuica GabrielBuica force-pushed the private/dbuica/CP-48195-v2 branch 2 times, most recently from 97f0194 to 874ffc8 Compare April 9, 2024 16:24
(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)
Copy link
Contributor

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.

Copy link
Contributor Author

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?

(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)
Copy link
Contributor

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.

module Attributes : sig
type 'a t

val fold : (string -> 'a -> 'b -> 'b) -> 'a t -> 'b -> 'b
Copy link
Contributor

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.

@GabrielBuica GabrielBuica force-pushed the private/dbuica/CP-48195-v2 branch from 031bce8 to ac1baee Compare April 17, 2024 14:45
@GabrielBuica GabrielBuica marked this pull request as ready for review April 17, 2024 14:45
@GabrielBuica GabrielBuica changed the title CP-48195 Instrument forkhelpers.ml with dt CP-48195: Split tracing library to avoid future cyclic dependencies Apr 17, 2024
@GabrielBuica GabrielBuica force-pushed the private/dbuica/CP-48195-v2 branch from bcc563a to ee9906b Compare April 19, 2024 12:34
Copy link
Member

@psafont psafont left a 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 <danutgabriel.buica@cloud.com>
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 <danutgabriel.buica@cloud.com>
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 <danutgabriel.buica@cloud.com>
@GabrielBuica GabrielBuica force-pushed the private/dbuica/CP-48195-v2 branch from ee9906b to d049d43 Compare April 19, 2024 14:49
@GabrielBuica
Copy link
Contributor Author

BVT 197315

Copy link
Member

@mg12 mg12 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

bvt passed

@robhoes robhoes merged commit f208e2f into xapi-project:master Apr 22, 2024
@GabrielBuica GabrielBuica deleted the private/dbuica/CP-48195-v2 branch January 8, 2025 10:50
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

Successfully merging this pull request may close these issues.

7 participants