mirror of
https://github.com/ocaml-tracing/ocaml-opentelemetry.git
synced 2026-05-05 17:04:52 -04:00
better error message for otlp http failures
This commit is contained in:
parent
59e2e854e5
commit
a4d95409ee
1 changed files with 4 additions and 3 deletions
|
|
@ -26,7 +26,7 @@ let report_err ~level:(provided_level : [ `Debug | `Warning | `Auto ]) (err : t)
|
||||||
"opentelemetry: ctrl-c captured, stopping")
|
"opentelemetry: ctrl-c captured, stopping")
|
||||||
| `Failure msg ->
|
| `Failure msg ->
|
||||||
Opentelemetry.Self_debug.log (compute_level Error) (fun () ->
|
Opentelemetry.Self_debug.log (compute_level Error) (fun () ->
|
||||||
Printf.sprintf "opentelemetry: export failed: %s" msg)
|
Printf.sprintf "opentelemetry: export failed:\n%s" msg)
|
||||||
| `Status
|
| `Status
|
||||||
( code,
|
( code,
|
||||||
{
|
{
|
||||||
|
|
@ -59,8 +59,9 @@ let decode_invalid_http_response ~attempt_descr ~code ~url (body : string) : t =
|
||||||
let bt = Printexc.get_backtrace () in
|
let bt = Printexc.get_backtrace () in
|
||||||
`Failure
|
`Failure
|
||||||
(Printf.sprintf
|
(Printf.sprintf
|
||||||
"httpc: decoding of status (url=%S, code=%d) failed with:\n\
|
"http server at %s returned code %d;\n\
|
||||||
|
trying to decode the body as protobuf failed:\n\
|
||||||
%s\n\
|
%s\n\
|
||||||
HTTP body: %s\n\
|
raw HTTP body (hex): %s\n\
|
||||||
%s"
|
%s"
|
||||||
url code (Printexc.to_string e) (str_to_hex body) bt)
|
url code (Printexc.to_string e) (str_to_hex body) bt)
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue