c-cube/ocaml-trace

Trace_core.add_data_to_span doesn't work for with_span

emjin opened this issue · 3 comments

I see there's a new release that looks relevant, so this might have been fixed already. As of 0.6, Trace_core.add_data_to_span works if you use enter_span and exit_span but not with_span. So

      let sp = Tracing.enter_span ~__FILE__ ~__LINE__ "Core_CLI.main_no_exn_handler" in
      let res = f () in
      Tracing.add_data_to_span sp ["test", `String "appear please"];
      Tracing.exit_span sp; 
      res

works

But not

  Tracing.with_span ~__FILE__ ~__LINE__ "Core_CLI.main_no_exn_handler"
    (fun sp -> 
              Tracing.add_data_to_span sp ["test", `String "appear please"];
              f ())

Not urgent but would be nice to have since with_span makes child spans.

This is, really, the job of the collector. Is this with trace-tef?

Got it. I'm using Opentelemetry_client_ocurl. I'll open an issue there.

Works with the recent 0.8 release of opentelemetry!