Skip to content

Commit

Permalink
ocurl: more info in debug mode
Browse files Browse the repository at this point in the history
  • Loading branch information
c-cube committed Mar 7, 2024
1 parent 4534b78 commit 03d9a6f
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions src/client-ocurl/opentelemetry_client_ocurl.ml
Original file line number Diff line number Diff line change
Expand Up @@ -181,7 +181,9 @@ end = struct
in
Ezcurl.post ~headers ~client ~params:[] ~url ~content:(`String data) ()
with
| Ok { code; _ } when code >= 200 && code < 300 -> ()
| Ok { code; _ } when code >= 200 && code < 300 ->
if !debug_ || config.debug then
Printf.eprintf "opentelemetry: got response code=%d\n%!" code
| Ok { code; body; headers = _; info = _ } ->
Atomic.incr n_errors;
Self_trace.add_event _sc
Expand All @@ -196,7 +198,8 @@ end = struct
with _ ->
spf "(could not decode status)\nraw bytes: %s" (str_to_hex body)
in
Printf.eprintf "error while sending:\n code=%d\n %s\n%!" code body
Printf.eprintf
"opentelemetry: error while sending:\n code=%d\n %s\n%!" code body
);
()
| exception Sys.Break ->
Expand Down

0 comments on commit 03d9a6f

Please sign in to comment.